[Bug middle-end/54299] Array parameter does not allow for iterator syntax
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Aug 17 15:40:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54299
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-08-17 15:40:42 UTC ---
I think the compiler's correct to reject the first example, the type of arr is
int* so it's not an array, and so the for loop calls begin(arr) and end(arr)
In the second example the parameter type is int(*)[10] so arr[0] is an array of
known bound, and so the for loop works.
More information about the Gcc-bugs
mailing list