================
@@ -0,0 +1,53 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -Wunterminated-string-initialization
%s -x c
+// RUN: %clang_cc1 -fsyntax-only -verify=cxx,expected
-Wunterminated-string-initialization %s -x c++
+
+
+#ifdef __cplusplus
+// C++ is stricter so the following cases should be warned about:
----------------
AaronBallman wrote:
I think we want the same test cases between C and C++, the only thing that
should be different is the expected diagnostic comments. e.g.,
```
char foo3[3] = "fo\0"; // cxx-error {{initializer-string for char array is too
long, array size is 3 but initializer has size 4 (including the null
terminating character)}}
```
is fine in C because the diagnostic will only be checked in C++ mode.
The only code that should be in the `#if` would be things like the typedefs for
C.
https://github.com/llvm/llvm-project/pull/143487
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits