summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/dynexcspec.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2023-12-18 15:15:09 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2023-12-18 17:40:26 +0100
commitd2c54902102ab9ee40cca16ae21f1bf3ad7c4066 (patch)
treeb5a1cd806ad4ca2c5a7a4cd488a05a76773d79ef /compilerplugins/clang/dynexcspec.cxx
parent3174749bb826fd653c923cadc98c7045a70bfd2f (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/dynexcspec.cxx')
-rw-r--r--compilerplugins/clang/dynexcspec.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/compilerplugins/clang/dynexcspec.cxx b/compilerplugins/clang/dynexcspec.cxx
index af733ec4f10f..2cedb8e046f2 100644
--- a/compilerplugins/clang/dynexcspec.cxx
+++ b/compilerplugins/clang/dynexcspec.cxx
@@ -13,6 +13,7 @@
#include "clang/AST/Comment.h"
+#include "compat.hxx"
#include "plugin.hxx"
// Remove dynamic exception specifications. See the mail thread starting at
@@ -115,7 +116,7 @@ public:
auto s = StringRef(
compiler.getSourceManager().getCharacterData(prev),
n);
- while (s.startswith("\\\n")) {
+ while (compat::starts_with(s, "\\\n")) {
s = s.drop_front(2);
while (!s.empty()
&& (s.front() == ' ' || s.front() == '\t'
@@ -126,7 +127,7 @@ public:
}
}
if (!s.empty() && s != "\\") {
- if (s.startswith("//")) {
+ if (compat::starts_with(s, "//")) {
beg = source.getBegin();
}
break;