http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52953
--- Comment #1 from meng at g dot clemson.edu 2012-04-12 21:53:36 UTC --- another example showing violation of c++11 3.3.3/4 ---------------------------- BEGIN ------------------------------- int main () { if (int a = 1) { void a (); // 1 } else { void a (); // 2 } while (int a = 0) { void a (); // 3 } for (int a = 0;;) { void a (); // 4 break; } for (; int a = 0;) { void a (); // 5 } return 0; } ---------------------------- END ------------------------------- According to my understanding, all numbered cases are illegal based on c++11 3.3.3/4.g++-4.7.0 correctly caught case 3 and 5 as compiler errors, the rest are accepted.