[Bug c++/89616] Parameter names can be redeclared in outermost block of a function definition

2021-08-26 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89616

Andrew Pinski  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #2 from Andrew Pinski  ---
Dup of bug 52953.

*** This bug has been marked as a duplicate of bug 52953 ***

[Bug c++/89616] Parameter names can be redeclared in outermost block of a function definition

2019-03-12 Thread fruitclover at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89616

Michael Kashkarov  changed:

   What|Removed |Added

 CC||fruitclover at gmail dot com

--- Comment #1 from Michael Kashkarov  ---
Created attachment 45954
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45954=edit
patch

Possible fix is attached (bootstraps x86_64), detects the following case:

 1 void foo(int x){
*2void x();
 3 }

but not sure if the following redefinition is legal (compiles with gcc/clang):

 1 class C {
 2   int x;
 3 public:
 4   C(int);
 5 };
 6 
 7 C::C(int x) try : x(1) {
*8 void x();
 9 } catch (...) {}

from [basic.scope.param]:
... A parameter name shall not be redeclared in the outermost block of the
function definition nor in the outermost block of any handler associated with a
function-try-block.

[Bug c++/89616] Parameter names can be redeclared in outermost block of a function definition

2019-03-07 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89616

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||accepts-invalid
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-03-07
 Ever confirmed|0   |1