================
@@ -8,6 +8,7 @@ void test_global_const() {
 }
 
 // String literal
+// NOTE: This only works in C++, not in C, as the analyzer treats string 
literals as non-const char arrays in C mode.
----------------
gamesh411 wrote:

The const keyword was introduced in the ANSI C standard (C89/C90), so from that 
standard on, we should have string literals as const char arrays.
And according to the docs: the latest [``clang defaults to C17 by 
default``](https://clang.llvm.org/docs/UsersManual.html), so this seems to be a 
bug to me.

https://github.com/llvm/llvm-project/pull/150417
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to