summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c99-init-4.c
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-02 18:03:20 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-02 18:03:20 +0000
commitfb213c8571691511c41345b832e6f6e1911c08cf (patch)
tree7ccd1aca680b7efb33ec9badfa5bf24703bbed11 /gcc/testsuite/gcc.dg/c99-init-4.c
parent516a329b4cd4a6fa7dffe83ba1c2c3cf7d924b6f (diff)
downloadgcc-fb213c8571691511c41345b832e6f6e1911c08cf.tar.gz
PR c/19435
* c-typeck.c (really_start_incremental_init): Reset constructor_max_index for arrays of incomplete type. testsuite: * gcc.dg/c99-init-4.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@94595 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/c99-init-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/c99-init-4.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c99-init-4.c b/gcc/testsuite/gcc.dg/c99-init-4.c
new file mode 100644
index 00000000000..70735578587
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c99-init-4.c
@@ -0,0 +1,8 @@
+/* Test for nested initialization of a compound literal: must not be
+ checked against outer array bounds. Bug 19435. */
+/* Origin: Joseph Myers <joseph@codesourcery.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s { char *p; };
+struct s a[1] = { { .p = ((char []){ 1, 2 }) } };