diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-11 11:04:44 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-11 13:48:34 +0200 |
commit | 5c142dd31de4a6d1c6ce9885ad06d84aca492152 (patch) | |
tree | d4218db272d4b2b216ad248eafaece285bf003b1 /compilerplugins/clang/mergeclasses.cxx | |
parent | 266abd09fd2d449351e356bc48f65c725b121247 (diff) |
loplugin:mergeclass, fix and update results
Change-Id: I0660833db69604c5c4dd3c5826f1baac3086e052
Diffstat (limited to 'compilerplugins/clang/mergeclasses.cxx')
-rw-r--r-- | compilerplugins/clang/mergeclasses.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compilerplugins/clang/mergeclasses.cxx b/compilerplugins/clang/mergeclasses.cxx index b6fccfe9418f..a6c1722206ff 100644 --- a/compilerplugins/clang/mergeclasses.cxx +++ b/compilerplugins/clang/mergeclasses.cxx @@ -120,11 +120,12 @@ bool MergeClasses::VisitCXXConstructExpr( const CXXConstructExpr* pCXXConstructE if (ignoreLocation(pCXXConstructExpr)) { return true; } - const CXXConstructorDecl* pCXXConstructorDecl = pCXXConstructExpr->getConstructor(); - const CXXRecordDecl* pParentCXXRecordDecl = pCXXConstructorDecl->getParent(); - if (ignoreLocation(pParentCXXRecordDecl)) { + // ignore calls when a sub-class is constructing it's superclass + if (pCXXConstructExpr->getConstructionKind() != CXXConstructExpr::ConstructionKind::CK_Complete) { return true; } + const CXXConstructorDecl* pCXXConstructorDecl = pCXXConstructExpr->getConstructor(); + const CXXRecordDecl* pParentCXXRecordDecl = pCXXConstructorDecl->getParent(); std::string s = pParentCXXRecordDecl->getQualifiedNameAsString(); addToInstantiatedSet(s); return true; |