void run() override
{ if (preRun())
{
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
}
bool VisitCXXRecordDecl(CXXRecordDecl const*);
};
bool RefCountingBase::VisitCXXRecordDecl(CXXRecordDecl const* recordDecl)
{ if (ignoreLocation(recordDecl)) returntrue; if (!recordDecl->isThisDeclarationADefinition()) returntrue;
int virtualWeakBase = 0; int virtualOWeakObject = 0; int virtualSimpleReferenceObject = 0; int virtualSvRefBase = 0; int virtualXmlImportContenxt = 0; int virtualVclReferenceBase = 0; int noRefCountingBases = 0;
std::string basePaths; auto BaseMatchesCallback = [&](const CXXBaseSpecifier* cxxBaseSpecifier, CXXBasePath& Paths) { if (!cxxBaseSpecifier->getType().getTypePtr()) returnfalse; const CXXRecordDecl* baseCXXRecordDecl = cxxBaseSpecifier->getType()->getAsCXXRecordDecl(); if (!baseCXXRecordDecl) returnfalse; if (baseCXXRecordDecl->isInvalidDecl()) returnfalse;
int total = virtualWeakBase + virtualOWeakObject + virtualSimpleReferenceObject
+ virtualSvRefBase + virtualXmlImportContenxt + virtualVclReferenceBase
+ noRefCountingBases; if (total > 1)
{
report(DiagnosticsEngine::Warning, "this class has multiple copies of a reference-counting base class, through " "inheritance paths %0",
recordDecl->getBeginLoc())
<< basePaths << recordDecl->getSourceRange();
} returntrue;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.