aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c99-init-4.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-02-02 18:03:20 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2005-02-02 18:03:20 +0000
commit493179dae3e45a9b25767c46c61f04ca3f9a3a17 (patch)
tree7ccd1aca680b7efb33ec9badfa5bf24703bbed11 /gcc/testsuite/gcc.dg/c99-init-4.c
parentc7273283dffbb501858dbfbecd42d5515c49ad8e (diff)
downloadgcc-493179dae3e45a9b25767c46c61f04ca3f9a3a17.zip
gcc-493179dae3e45a9b25767c46c61f04ca3f9a3a17.tar.gz
gcc-493179dae3e45a9b25767c46c61f04ca3f9a3a17.tar.bz2
re PR c/19435 (spurious warnings with nested array constructors)
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. From-SVN: r94595
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 0000000..7073557
--- /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 }) } };