summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wcxx-compat-14.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-17 13:21:23 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-17 13:21:23 +0000
commit019c559b7e7214b8016a97cf19168a26b828520a (patch)
treea18365a2a12b66e43938e6451b9ef906434cd866 /gcc/testsuite/gcc.dg/Wcxx-compat-14.c
parentcf917515dbfbb248a4c828e222714fd7baceafce (diff)
downloadgcc-019c559b7e7214b8016a97cf19168a26b828520a.tar.gz
./:
* c-pch.c (get_ident): Don't set size of templ array. (pch_init): Don't set size of partial_pch array. * c-typeck.c (digest_init): If -Wc++-compat, warn about using a string constant to intialize an array whose size is the length of the string. testsuite/: * gcc.dg/Wcxx-compat-14.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148611 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/Wcxx-compat-14.c')
-rw-r--r--gcc/testsuite/gcc.dg/Wcxx-compat-14.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-14.c b/gcc/testsuite/gcc.dg/Wcxx-compat-14.c
new file mode 100644
index 00000000000..23783711be6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-14.c
@@ -0,0 +1,6 @@
+/* { dg-do compile } */
+/* { dg-options "-Wc++-compat" } */
+
+char a1[] = "a";
+char a2[1] = "a"; /* { dg-warning "C\[+\]\[+\]" } */
+char a3[2] = "a";