c++: Add new test [PR92427]
authorMarek Polacek <polacek@redhat.com>
Tue, 7 Jul 2020 23:28:04 +0000 (19:28 -0400)
committerMarek Polacek <polacek@redhat.com>
Tue, 7 Jul 2020 23:28:53 +0000 (19:28 -0400)
Fixed in r10-5578.

PR c++/92427
* g++.dg/ext/flexary37.C: New test.

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

diff --git a/gcc/testsuite/g++.dg/ext/flexary37.C b/gcc/testsuite/g++.dg/ext/flexary37.C
new file mode 100644 (file)
index 0000000..ceb5053
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/92427
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+class C {
+private:
+    int a; int b;
+public:
+    C(int A, int B) : a(A), b(B) { }
+    ~C() { }
+};
+
+struct y { // { dg-error "unknown array size in delete" }
+    int a; C b[];
+} y = { 1, { { 2, 3 } } }; // { dg-error "unknown array size in delete" }