summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/stringstatic.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/compilerplugins/clang/stringstatic.cxx b/compilerplugins/clang/stringstatic.cxx
index a7439608d556..0d4fc0574bf4 100644
--- a/compilerplugins/clang/stringstatic.cxx
+++ b/compilerplugins/clang/stringstatic.cxx
@@ -101,6 +101,9 @@ bool StringStatic::VisitVarDecl(VarDecl const* varDecl)
return true;
}
}
+ // cannot make something constexpr if it is also declared in a header file as extern
+ if (loplugin::hasExternalLinkage(varDecl))
+ return true;
report(DiagnosticsEngine::Warning,
"rather declare this as constexpr",
varDecl->getLocation())