Kaydet (Commit) 7276c346 authored tarafından Andrzej Hunt's avatar Andrzej Hunt Kaydeden (comit) Noel Grandin

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/19496Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 46ceb619
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment