[Bug c++/70932] New: flexible array member with non-trivial destructor
jens.maurer at gmx dot net
gcc-bugzilla@gcc.gnu.org
Tue May 3 21:43:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70932
Bug ID: 70932
Summary: flexible array member with non-trivial destructor
Product: gcc
Version: 6.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jens.maurer at gmx dot net
Target Milestone: ---
Testcase:
struct A {
~A();
};
struct S {
S() : i(0) { }
int i;
A a[];
};
$ g++ -v flex.cc
gcc version 6.1.0 (GCC)
flex.cc: In constructor ‘S::S()’:
flex.cc:6:12: error: unknown array size in delete
This used to work with gcc 5.x. (I understand the destructor of A is not
called for a[] here, because the number of elements is unknown.)
More information about the Gcc-bugs
mailing list