[Bug c++/53211] range-based 'for' expression of type 'const int []' has incomplete type

i.nixman at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu May 3 16:04:00 GMT 2012


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

--- Comment #2 from niXman <i.nixman at gmail dot com> 2012-05-03 16:04:26 UTC ---
This code also works:

#include <iostream>

template<typename... Args>
void func(Args... args) {
   const int arr[] = {args...};
   for (int it: arr) { // !!!!!!!!!!!!!!!!!!!!!
      std::cout << it << std::endl;
   }
}

int main() {
   func(1,2,3,4);
}


I'm confused...



More information about the Gcc-bugs mailing list