[clang-tools-extra] [clang-tidy] Add a new check 'modernize-use-string-view' (PR #172170)
Yanzuo Liu via cfe-commits
cfe-commits at lists.llvm.org
Sun Dec 28 01:06:17 PST 2025
================
@@ -0,0 +1,373 @@
+// RUN: %check_clang_tidy \
+// RUN: -std=c++17-or-later %s modernize-use-string-view %t -- \
+// RUN: -- -isystem %clang_tidy_headers
+
+#include <string>
+
+namespace std {
+namespace literals {
+namespace string_literals {
+ string operator""s(const char *, size_t);
+}
+namespace string_view_literals {
+ string_view operator""sv(const char *, size_t);
+}
+}
----------------
zwuis wrote:
Move it to mock header so that it can be used by other tests.
https://github.com/llvm/llvm-project/pull/172170
More information about the cfe-commits
mailing list