diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-22 09:59:11 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-22 09:59:46 +0200 |
commit | 24600dcf3118cb01d57c31518d36be870f73e79c (patch) | |
tree | a52948f34190ca54071d7d457b91471fb1703ad7 /compilerplugins/clang | |
parent | 83eb114394879cbfd073322a51c47d02553c1fcf (diff) |
loplugin:constantfunction
Change-Id: I7cb5b0c2cf9ade557173ca596ea5d42d853ff448
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/store/constantfunction.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compilerplugins/clang/store/constantfunction.cxx b/compilerplugins/clang/store/constantfunction.cxx index 4f367fc709fb..064d97850483 100644 --- a/compilerplugins/clang/store/constantfunction.cxx +++ b/compilerplugins/clang/store/constantfunction.cxx @@ -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 = ""; |