aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/c99-flex-array-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.dg/c99-flex-array-1.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.dg/c99-flex-array-1.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/c99-flex-array-1.c b/gcc-4.8/gcc/testsuite/gcc.dg/c99-flex-array-1.c
new file mode 100644
index 000000000..b14397ad2
--- /dev/null
+++ b/gcc-4.8/gcc/testsuite/gcc.dg/c99-flex-array-1.c
@@ -0,0 +1,8 @@
+/* Test for invalid uses of flexible array members. */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
+
+struct s1 { int x[]; }; /* { dg-error "empty struct" "empty" } */
+struct s2 { int :1; int x[]; }; /* { dg-error "empty struct" "empty" } */
+struct s3 { int x[]; int y; }; /* { dg-error "not at end" "not at end" } */
+struct s4 { int x; int y[]; };