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.