http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54320
--- Comment #3 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-08-19 07:24:52 UTC --- 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)