diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2023-12-18 15:15:09 +0100 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2023-12-18 17:40:26 +0100 |
commit | d2c54902102ab9ee40cca16ae21f1bf3ad7c4066 (patch) | |
tree | b5a1cd806ad4ca2c5a7a4cd488a05a76773d79ef /compilerplugins/clang/simplifypointertobool.cxx | |
parent | 3174749bb826fd653c923cadc98c7045a70bfd2f (diff) |
-Werror,-Wdeprecated-declarations
> compilerplugins/clang/casttovoid.cxx:452:18: error: 'endswith' is deprecated: Use ends_with instead [-Werror,-Wdeprecated-declarations]
> .endswith(".h"));
> ^~~~~~~~
> ends_with
> ~/llvm/inst/include/llvm/ADT/StringRef.h:276:19: note: 'endswith' has been explicitly marked deprecated here
> [[nodiscard]] LLVM_DEPRECATED(
> ^
etc. after
<https://github.com/llvm/llvm-project/commit/5ac12951b4e9bbfcc5791282d0961ec2b65575e9>
"[ADT] Deprecate StringRef::{starts,ends}with (#75491)" on Clang 18 trunk, where
<https://github.com/llvm/llvm-project/commit/1b97645e56bf321b06d1353024339958b64fd242>
"[ADT] Introduce StringRef::{starts,ends}_width{,_insensitive}" had been added
towards Clang 16
Change-Id: Icb3e43b7d6be6f877815285913d846f766eddebf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160919
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'compilerplugins/clang/simplifypointertobool.cxx')
-rw-r--r-- | compilerplugins/clang/simplifypointertobool.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compilerplugins/clang/simplifypointertobool.cxx b/compilerplugins/clang/simplifypointertobool.cxx index 11aed0f317b7..1a9471fcf877 100644 --- a/compilerplugins/clang/simplifypointertobool.cxx +++ b/compilerplugins/clang/simplifypointertobool.cxx @@ -19,6 +19,7 @@ #include "plugin.hxx" #include "check.hxx" +#include "compat.hxx" /** Simplify boolean expressions involving smart pointers e.g. @@ -262,7 +263,7 @@ private: auto const s = StringRef(compiler.getSourceManager().getCharacterData(start), Lexer::MeasureTokenLength(start, compiler.getSourceManager(), compiler.getLangOpts())); - if (s.empty() || s.startswith("\\\n")) + if (s.empty() || compat::starts_with(s, "\\\n")) { continue; } @@ -279,7 +280,7 @@ private: auto const s = StringRef(compiler.getSourceManager().getCharacterData(start1), Lexer::MeasureTokenLength(start1, compiler.getSourceManager(), compiler.getLangOpts())); - if (!(s.empty() || s.startswith("\\\n"))) + if (!(s.empty() || compat::starts_with(s, "\\\n"))) { break; } |