loplugin:mergeclasses fix ignoring some stuff

Seems that calling getCanonicalDecl here results in us sometimes picking
up forward-decl's, which hides stuff

Also make the python processing code spit out a message if I manage to
mess up the log files

Change-Id: I08bf50eb26cf463c126507b51535b0a0fc9f7ecf
This commit is contained in:
Noel Grandin
2018-07-12 11:14:13 +02:00
parent 0d7193bd2c
commit 85cf4d25a3
6 changed files with 14 additions and 2 deletions

View File

@@ -148,7 +148,7 @@ bool MergeClasses::VisitCXXRecordDecl(const CXXRecordDecl* decl)
}
if (decl->isThisDeclarationADefinition())
{
SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(decl->getCanonicalDecl()->getLocStart());
SourceLocation spellingLocation = compiler.getSourceManager().getSpellingLoc(decl->getLocStart());
std::string filename = compiler.getSourceManager().getFilename(spellingLocation);
filename = filename.substr(strlen(SRCDIR));
std::string s = decl->getQualifiedNameAsString();