bool ExternAndNotDefined::VisitFunctionDecl(const FunctionDecl * functionDecl) { if (ignoreLocation(functionDecl)) { returntrue;
} if (functionDecl->isDefined() || compat::isPureVirtual(functionDecl)
|| (functionDecl->getLinkageAndVisibility().getLinkage()
!= compat::Linkage::External)) { returntrue;
} //TODO, filtering out anything template for now: if (functionDecl->isDependentContext()) { returntrue;
}
CXXRecordDecl const * r = dyn_cast<CXXRecordDecl>(functionDecl->getDeclContext()); if (r != nullptr && r->getTemplateSpecializationKind() != TSK_Undeclared) { returntrue;
} // this is the bison/flex C API, it has to be defined this way
std::string functionName = functionDecl->getNameAsString(); if (functionName == "yyerror" || functionName == "yyparse" || functionName == "yylex") { returntrue;
} // see vcl/unx/gtk/app/gtksys.cxx, typename conflicts prevent using the right include if (functionName == "gdk_x11_screen_get_screen_number") { returntrue;
} if (!compiler.getSourceManager().isInMainFile(functionDecl->getLocation()))
{ returntrue;
}
report(
DiagnosticsEngine::Warning, "extern prototype in main file without definition",
functionDecl->getLocation())
<< functionDecl->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.