summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/simplifyconstruct.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-09-13 21:21:20 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-09-14 10:39:50 +0200
commitc62d02bcb9192c839767d6824751002696c3ed3f (patch)
treeba4fbb2bca630e05504907e909f4c2d5bbfefaab /compilerplugins/clang/simplifyconstruct.cxx
parent4e5f89d2d3511b6421b388ecaba2f61ada14d084 (diff)
Improve loplugin:simplifyconstruct warnings
Change-Id: I0a64d0eb9938d5a99416dbe4078ba4c05e5d588b Reviewed-on: https://gerrit.libreoffice.org/60465 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/simplifyconstruct.cxx')
-rw-r--r--compilerplugins/clang/simplifyconstruct.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/compilerplugins/clang/simplifyconstruct.cxx b/compilerplugins/clang/simplifyconstruct.cxx
index fd5ba5027d01..172a1bd48029 100644
--- a/compilerplugins/clang/simplifyconstruct.cxx
+++ b/compilerplugins/clang/simplifyconstruct.cxx
@@ -55,9 +55,10 @@ bool SimplifyConstruct::VisitCXXConstructExpr(CXXConstructExpr const* constructE
&& isa<CXXNullPtrLiteralExpr>(constructExpr->getArg(0)->IgnoreParenImpCasts()))
{
report(DiagnosticsEngine::Warning,
- "no need to explicitly init this with nullptr, just use default constructor",
+ "no need to explicitly init an instance of %0 with nullptr, just use default "
+ "constructor",
constructExpr->getSourceRange().getBegin())
- << constructExpr->getSourceRange();
+ << constructExpr->getType() << constructExpr->getSourceRange();
}
return true;
}