[Libreoffice-commits] core.git: compilerplugins/clang
Andrzej Hunt
andrzej at ahunt.org
Tue Oct 20 23:54:34 PDT 2015
compilerplugins/clang/badvectorinit.cxx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 7276c346678c2cb51c14f6011659376890bbabea
Author: Andrzej Hunt <andrzej at ahunt.org>
Date: Tue Oct 20 21:23:42 2015 +0200
Ignore the default constructor for loplugin:badvectorinit too
The default constructor doesn't necessarily have 0 parameters,
hence we need to explicitly test for this too.
Change-Id: I685c44ab373ec8234a86824a77cc523a355c8b05
Reviewed-on: https://gerrit.libreoffice.org/19496
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
Tested-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/compilerplugins/clang/badvectorinit.cxx b/compilerplugins/clang/badvectorinit.cxx
index 005726e..709a65d 100644
--- a/compilerplugins/clang/badvectorinit.cxx
+++ b/compilerplugins/clang/badvectorinit.cxx
@@ -172,7 +172,10 @@ bool BadVectorInit::VisitCXXConstructExpr(const CXXConstructExpr* expr)
const CXXConstructorDecl *consDecl = expr->getConstructor();
consDecl = consDecl->getCanonicalDecl();
- if (consDecl->param_size() == 0)
+ // The default constructor can potentially have a parameter, e.g.
+ // in glibcxx-debug the default constructor is:
+ // explicit vector(const _Allocator& __a = _Allocator())
+ if (consDecl->param_size() == 0 || consDecl->isDefaultConstructor())
return true;
std::string aParentName = consDecl->getParent()->getQualifiedNameAsString();
More information about the Libreoffice-commits
mailing list