aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-11-15 12:59:08 -0500
committerJason Merrill <jason@redhat.com>2021-11-15 18:48:04 -0500
commit29e4163a092ce08ba3a88a05ac2fa3f23b1cec28 (patch)
tree28b5b24240d476fda885133d8042c5d1263dcf71 /gcc/testsuite
parent323026c7dfe23e1093e80f7db5f4851d1a867b62 (diff)
downloadgcc-29e4163a092ce08ba3a88a05ac2fa3f23b1cec28.zip
gcc-29e4163a092ce08ba3a88a05ac2fa3f23b1cec28.tar.gz
gcc-29e4163a092ce08ba3a88a05ac2fa3f23b1cec28.tar.bz2
c++: split_nonconstant_init and flexarrays
split_nonconstant_init was doing the wrong thing for both the initialization and cleanup here; we know the size from the initializer, and we can pass it along. This doesn't make the testcase work, since the y destructor is still broken, but it removes the wrong error for the aggregate initialization. gcc/cp/ChangeLog: * typeck2.c (split_nonconstant_init_1): Handle flexarrays better. gcc/testsuite/ChangeLog: * g++.dg/ext/flexary37.C: Remove expected error.
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/g++.dg/ext/flexary37.C2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/testsuite/g++.dg/ext/flexary37.C b/gcc/testsuite/g++.dg/ext/flexary37.C
index ceb5053..5cd48c1 100644
--- a/gcc/testsuite/g++.dg/ext/flexary37.C
+++ b/gcc/testsuite/g++.dg/ext/flexary37.C
@@ -12,4 +12,4 @@ public:
struct y { // { dg-error "unknown array size in delete" }
int a; C b[];
-} y = { 1, { { 2, 3 } } }; // { dg-error "unknown array size in delete" }
+} y = { 1, { { 2, 3 } } };