[Bug c++/71378] variable-sized object may not be initialized
marxin at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Jun 3 11:25:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71378
--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
Ok, as Jakub mentioned in:
https://gcc.gnu.org/ml/gcc-patches/2016-06/msg00268.html
C++ FE should reject initialization of a variable length object.
clang++ 3.7.0 rejects the reduced test case:
clang++ tc.ii
tc.ii:9:40: error: variable-sized object may not be initialized
void B::FillLoadPartitionInfo() { char a[s_MDSPartIDStr.GetLen()] = "foo"; }
^ ~~~~~
1 error generated.
Martin
More information about the Gcc-bugs
mailing list