This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53211] range-based 'for' expression of type 'const int []' has incomplete type
- From: "i.nixman at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 03 May 2012 16:04:26 +0000
- Subject: [Bug c++/53211] range-based 'for' expression of type 'const int []' has incomplete type
- Auto-submitted: auto-generated
- References: <bug-53211-4@http.gcc.gnu.org/bugzilla/>
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...