summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/mergeclasses.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/mergeclasses.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/mergeclasses.cxx')
-rw-r--r--compilerplugins/clang/mergeclasses.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/compilerplugins/clang/mergeclasses.cxx b/compilerplugins/clang/mergeclasses.cxx
index 5ac69bc52397..0c023a9bd15a 100644
--- a/compilerplugins/clang/mergeclasses.cxx
+++ b/compilerplugins/clang/mergeclasses.cxx
@@ -87,14 +87,15 @@ public:
bool ignoreClass(StringRef s)
{
// ignore stuff in the standard library, and UNO stuff we can't touch.
- if (s.startswith("rtl::") || s.startswith("sal::") || s.startswith("com::sun::")
- || s.startswith("std::") || s.startswith("boost::")
+ if (compat::starts_with(s, "rtl::") || compat::starts_with(s, "sal::")
+ || compat::starts_with(s, "com::sun::") || compat::starts_with(s, "std::")
+ || compat::starts_with(s, "boost::")
|| s == "OString" || s == "OUString" || s == "bad_alloc")
{
return true;
}
// ignore instantiations of pointers and arrays
- if (s.endswith("*") || s.endswith("]")) {
+ if (compat::ends_with(s, "*") || compat::ends_with(s, "]")) {
return true;
}
return false;