Fix a CLANG_VERSION check

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 15 February 2022 17:21 UTC

These functions became available with "[clang] Move two utility functions into SourceManager" towards Clang 8 and "Fix isInSystemMacro to handle pasted macros" towards Clang 9

Change-Id: I95b20bc88ff416b49502bdea23e223e6fa966eae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129970

###

diff --git a/compilerplugins/clang/stringliteraldefine.cxx b/compilerplugins/clang/stringliteraldefine.cxx
index 0eda65e7bea2..3eef01533ef3 100644
--- a/compilerplugins/clang/stringliteraldefine.cxx
+++ b/compilerplugins/clang/stringliteraldefine.cxx
@@ -62,8 +62,7 @@ public:
// check if it is the right kind of macro (not particularly reliable checks)
if (!macroLoc.isValid() || !compiler.getSourceManager().isInMainFile(macroLoc)
|| compiler.getSourceManager().isInSystemHeader(macroLoc)
-// not sure when these became available
-#if CLANG_VERSION >= 130000
+#if CLANG_VERSION >= 90000
|| compiler.getSourceManager().isWrittenInBuiltinFile(macroLoc)
|| compiler.getSourceManager().isWrittenInScratchSpace(macroLoc)
|| compiler.getSourceManager().isWrittenInCommandLineFile(macroLoc)

2361b6215bb4 Fix a CLANG_VERSION check
compilerplugins/clang/stringliteraldefine.cxx | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share