if (loplugin::hasPathnamePrefix(aFileName, SRCDIR "/chart2/source/")) returntrue; if (loplugin::isSamePathname(aFileName, SRCDIR "/include/sfx2/recentdocsview.hxx")) returntrue; if (loplugin::isSamePathname(aFileName, SRCDIR "/include/sfx2/templatelocalview.hxx")) returntrue; if (loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stortree.hxx")
|| loplugin::isSamePathname(aFileName, SRCDIR "/store/source/stordata.hxx")) returntrue; if (loplugin::isSamePathname(aFileName, SRCDIR "/sw/source/uibase/inc/dbtree.hxx")) returntrue;
const CXXRecordDecl* parentCXXRecordDecl = dyn_cast<CXXRecordDecl>(fieldDecl->getDeclContext()); if (!parentCXXRecordDecl) { returntrue;
}
fieldDecl = fieldDecl->getCanonicalDecl();
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; for (const FieldDecl* baseFieldDecl : baseCXXRecordDecl->fields())
{ // TODO look for overlaps even with private fields
if (baseFieldDecl->getAccess() == AS_private
|| !baseFieldDecl->getDeclName().isIdentifier()
|| fieldDecl->getName() != baseFieldDecl->getName()) { continue;
}
std::string sPath; for (CXXBasePathElement const & pathElement : Paths) { if (!sPath.empty()) {
sPath += "->";
}
sPath += pathElement.Class->getNameAsString();
}
sPath += "->";
sPath += baseCXXRecordDecl->getNameAsString();
report(DiagnosticsEngine::Warning, "data member %0 is shadowing member in superclass, through inheritance path %1",
fieldDecl->getBeginLoc())
<< fieldDecl->getName()
<< sPath
<< fieldDecl->getSourceRange();
report(DiagnosticsEngine::Note, "superclass member here",
baseFieldDecl->getBeginLoc())
<< baseFieldDecl->getSourceRange();
} returnfalse;
};
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.