This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]