aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vla-init-4.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm@polyomino.org.uk>2004-09-28 20:35:26 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2004-09-28 20:35:26 +0100
commitef7878226aa58cf991bcf3b61c43b4e89e4f5a06 (patch)
tree5fc1cb98a75ae0a4738fa2fd992b53aee46095a7 /gcc/testsuite/gcc.dg/vla-init-4.c
parent346c5b01de84d0ca4eebd2934a6e95648919c76f (diff)
downloadgcc-ef7878226aa58cf991bcf3b61c43b4e89e4f5a06.zip
gcc-ef7878226aa58cf991bcf3b61c43b4e89e4f5a06.tar.gz
gcc-ef7878226aa58cf991bcf3b61c43b4e89e4f5a06.tar.bz2
re PR c/16409 (ICE in size_binop, at fold-const.c)
PR c/16409 * c-decl.c (start_decl): Check for initializing incomplete array of VLAs. (build_compound_literal): Check for TYPE being error_mark_node. * c-parse.in (primary): Check for VLA compound literals. testsuite: * gcc.dg/vla-init-2.c, gcc.dg/vla-init-3.c, gcc.dg/vla-init-4.c, gcc.dg/vla-init-5.c: New tests. From-SVN: r88248
Diffstat (limited to 'gcc/testsuite/gcc.dg/vla-init-4.c')
-rw-r--r--gcc/testsuite/gcc.dg/vla-init-4.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vla-init-4.c b/gcc/testsuite/gcc.dg/vla-init-4.c
new file mode 100644
index 0000000..0f0e332
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vla-init-4.c
@@ -0,0 +1,7 @@
+/* Test for ICE on VLA compound literal. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+const int i = 1;
+void foo() { char *p = (char [i]){ "" }; } /* { dg-error "error: compound literal has variable size" } */