summaryrefslogtreecommitdiff
path: root/compilerplugins/clang
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-05-02 15:08:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-04 12:28:35 +0200
commit05e3d24602b8df6a476233d0a4e3bef23abc1c72 (patch)
treee3356bc951f7b4dc9eaf0bc1940773d6302a5a5b /compilerplugins/clang
parent7c053f115512b44838a0a4f21541e7ba54590950 (diff)
replace createFromAscii with OUString literals in sw
and adjust the loplugin:stringstatic to cope with OUString that is also declared in a header as extern, in which case we cannot mark it as constexpr. Change-Id: I108aa3ff8cb06a9a6d345cd951883b52dd0318f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167106 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'compilerplugins/clang')
-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())