[Bug c++/54320] [c++11] range access to VLA

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 10 19:40:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54320

--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to vincenzo Innocente from comment #3)
> int foo2(int N) {
>   int v[N];
>   for ( auto a : v)
>     if (a) return a;
>   return 0;
> }
> 
> works, though was similar to std::begin(v) std::end(v)

Similar, but not the same:

"if _RangeT is an array type, begin-expr and end-expr are __range and __range +
__bound, respectively, where __bound is the array bound."



More information about the Gcc-bugs mailing list