summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-22 09:59:11 +0200
committerNoel Grandin <noel@peralex.com>2015-05-22 09:59:46 +0200
commit24600dcf3118cb01d57c31518d36be870f73e79c (patch)
treea52948f34190ca54071d7d457b91471fb1703ad7 /compilerplugins
parent83eb114394879cbfd073322a51c47d02553c1fcf (diff)
loplugin:constantfunction
Change-Id: I7cb5b0c2cf9ade557173ca596ea5d42d853ff448
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/store/constantfunction.cxx7
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 = "";