[PATCH] D148367: [ADT] add StringViewExtras llvm::starts_with for std::string_view

Erich Keane via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 14 12:35:24 PDT 2023


erichkeane added inline comments.


================
Comment at: llvm/include/llvm/ADT/StringViewExtras.h:24
+// is upgraded to C++20, remove this header and users.
+#ifdef __cpp_lib_starts_ends_with
+#warning "remove llvm::starts_with"
----------------
This might be a bit noisy depending on how compilers/libraries define this in C++17 mode.  We might want a __cplusplus > (whatever the 2020 value is) here as well.


================
Comment at: llvm/unittests/ADT/StringViewExtrasTest.cpp:22
+  EXPECT_FALSE(llvm::starts_with(haystack, '\0'));
+  EXPECT_FALSE(llvm::starts_with(haystack, '\0'));
+  EXPECT_TRUE(llvm::starts_with(haystack, "hello"));
----------------
Why is this running this 2x in a row?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148367/new/

https://reviews.llvm.org/D148367



More information about the llvm-commits mailing list