loplugin:constantfunction

Change-Id: I7cb5b0c2cf9ade557173ca596ea5d42d853ff448
This commit is contained in:
Noel Grandin
2015-05-22 09:59:11 +02:00
parent 83eb114394
commit 24600dcf31
54 changed files with 46 additions and 388 deletions

View File

@@ -144,7 +144,7 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
return true;
}
// static with inline body will be optimised at compile-time to a constant anyway
if (pCXXMethodDecl->isStatic() && pCXXMethodDecl->hasInlineBody()) {
if (pCXXMethodDecl->isStatic() && (pCXXMethodDecl->hasInlineBody() || pCXXMethodDecl->isInlineSpecified())) {
return true;
}
// this catches some stuff in templates
@@ -412,6 +412,11 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
{
return true;
}
// LINK callback which supplies a return value which means something
if (aFunctionName == "SfxVirtualMenu::Highlight" || aFunctionName == "framework::MenuManager::Highlight"
|| aFunctionName == "framework::MenuBarManager::Highlight") {
return true;
}
// can't mess with the TYPEINIT macros in include/tools/rtti.hxx or the LINK macros in include/tools/link.hxx
std::string aImmediateMacro = "";