[Bug c++/70555] ICE in expand_expr_real_1 accessing a multi-dimensional VLA via lambda-capture
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 5 22:20:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70555
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Actually, I did find where N3366
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3639.html) disallows
the test case in vla7.C:
Change in 8.3.4 dcl.array paragraph 1 ...:
In a declaration T D where D has the form
D1 [ expression opt ] attribute-specifier-seq opt
and the type of the identifier in the declaration T D1 is
"derived-declarator-type-list T", then the type of the identifier of D is an
array type; [...] T is called the array element type; this type shall not be a
[...] an array of unknown or runtime bound...
According to this specification (which was never ratified and ended up being
removed from the final C++ standard), the test case in comment #0 would also be
ill-formed. Yet, GCC accepts such VLAs in most (all?) other contexts, so I'm
not sure that rejecting them here is helpful (though it certainly is
inconsistent).
I'm going to leave this as ice-on-valid code since as long as such arrays are
accepted in other contexts I think it makes sense to accept it here (and also
in vla7.C).
More information about the Gcc-bugs
mailing list