[committed] c++: Add new test [PR92427]

Message ID 20200707233010.620238-1-polacek@redhat.com
State New
Headers show
Series
  • [committed] c++: Add new test [PR92427]
Related show

Commit Message

Richard Biener via Gcc-patches July 7, 2020, 11:30 p.m.
Fixed in r10-5578.

	PR c++/92427
	* g++.dg/ext/flexary37.C: New test.
---
 gcc/testsuite/g++.dg/ext/flexary37.C | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 gcc/testsuite/g++.dg/ext/flexary37.C


base-commit: 161aa50ee2d1142802d7200733fee1cf532d6696
-- 
2.26.2

Patch

diff --git a/gcc/testsuite/g++.dg/ext/flexary37.C b/gcc/testsuite/g++.dg/ext/flexary37.C
new file mode 100644
index 00000000000..ceb5053de2e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/flexary37.C
@@ -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" }