[Bug c++/52953] g++-4.7.0 fails to detect function parameter name redeclarations.

meng at g dot clemson.edu gcc-bugzilla@gcc.gnu.org
Thu Apr 12 21:53:00 GMT 2012


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.



More information about the Gcc-bugs mailing list