[clang] [Clang][UnsafeBufferUsage] Warn about two-arg string_view constructors. (PR #180471)
Rohan Jacob-Rao via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 13 14:28:15 PST 2026
================
@@ -0,0 +1,37 @@
+// RUN: %clang_cc1 -std=c++20 -Wunsafe-buffer-usage -verify %s
+
+namespace std {
+ typedef __SIZE_TYPE__ size_t;
+
+ template <typename CharT>
+ class basic_string_view {
----------------
rohanjr wrote:
It looks like you're implicitly supporting `basic_string_view`s containing types other than `char`. If that's true, could you add one test for a type other than `char`?
https://github.com/llvm/llvm-project/pull/180471
More information about the cfe-commits
mailing list