aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2016-01-30 17:30:32 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2016-01-30 10:30:32 -0700
commit343c05d39f7fcdf55178853884113715bc7bcc2b (patch)
tree861b39d4e0bd1f2f10130d430f115bbeae960ff8 /gcc
parentd6c3a5392038022e5b236a244a9b33210875383d (diff)
downloadgcc-343c05d39f7fcdf55178853884113715bc7bcc2b.zip
gcc-343c05d39f7fcdf55178853884113715bc7bcc2b.tar.gz
gcc-343c05d39f7fcdf55178853884113715bc7bcc2b.tar.bz2
PR r++/68490 - error initializing a structure with a flexible array membe
gcc/testsuite/ChangeLog: 2016-01-30 Martin Sebor <msebor@redhat.com> PR c++/68490 * g++.dg/ext/flexary10.C: New test. From-SVN: r233010
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/ext/flexary10.C18
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index fc4232d..3bea4af 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-30 Martin Sebor <msebor@redhat.com>
+
+ PR c++/68490
+ * g++.dg/ext/flexary10.C: New test.
+
2016-01-30 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/66707
diff --git a/gcc/testsuite/g++.dg/ext/flexary10.C b/gcc/testsuite/g++.dg/ext/flexary10.C
new file mode 100644
index 0000000..f2868f3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/flexary10.C
@@ -0,0 +1,18 @@
+// PR c++/68490 - error initializing a structure with a flexible array member
+// { dg-do compile }
+// { dg-options "-Wpedantic" }
+
+struct A {
+ int n;
+ int a [];
+};
+
+struct A foo (void)
+{
+ // Verify the initializer below is accepted for compatibility with gcc
+ // (in C mode).
+ static struct A
+ a = { 2, { 1, 0 } }; // { dg-warning "initialization of a flexible array member" }
+
+ return a;
+}