================
@@ -0,0 +1,147 @@
+// RUN: %check_clang_tidy -check-suffix=DONTCHECK \
+// RUN: -std=c++20-or-later %s modernize-use-string-view %t -- \
+// RUN: --config="{CheckOptions:
{modernize-use-string-view.CheckOverloadedFunctions: false}}"
+
+// RUN: %check_clang_tidy -check-suffix=CHECK \
+// RUN: -std=c++20-or-later %s modernize-use-string-view %t -- \
+// RUN: --config="{CheckOptions:
{modernize-use-string-view.CheckOverloadedFunctions: true}}"
+
+#include <string>
+#include <utility>
+
+namespace overload_funcs_redeclared {
+std::basic_string<char> overload(int);
+std::string overload(int);
+std::string overload(int) { return "int"; }
+// CHECK-MESSAGES-DONTCHECK:[[@LINE-1]]:1: warning: consider using
'std::string_view' to avoid unnecessary copying and allocations
[modernize-use-string-view]
+// CHECK-MESSAGES-CHECK:[[@LINE-2]]:1: warning: consider using
'std::string_view' to avoid unnecessary copying and allocations
[modernize-use-string-view]
----------------
zeyi2 wrote:
Small nit:
```suggestion
// CHECK-MESSAGES-CHECK:[[@LINE-2]]:1: warning: consider using
'std::string_view' to avoid unnecessary copying and allocations
```
Same as below :)
https://github.com/llvm/llvm-project/pull/196387
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits