Add testcase of PR c++/89404, already fixed in trunk.
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 7 Feb 2020 10:05:30 +0000 (11:05 +0100)
committerPaolo Carlini <paolo.carlini@oracle.com>
Fri, 7 Feb 2020 10:05:30 +0000 (11:05 +0100)
PR c++/89404
* g++.dg/ext/vla21.C: New.

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/vla21.C [new file with mode: 0644]

index 32aa39c02a4e3cdf2621a64f71f38fd214d08570..bec80b2a94f36b2947fa5dc4ce4981c1cab8f958 100644 (file)
@@ -1,3 +1,8 @@
+2020-02-07  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/89404
+       * g++.dg/ext/vla21.C: New.
+
 2020-02-07  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/93615
diff --git a/gcc/testsuite/g++.dg/ext/vla21.C b/gcc/testsuite/g++.dg/ext/vla21.C
new file mode 100644 (file)
index 0000000..0923cef
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/89404
+// { dg-additional-options "-Wno-vla" }
+
+void
+foo (int n)
+{
+  struct {} a[1][n] (+a[0]);  // { dg-error "initialized" }
+}