https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85505

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathan at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
clang reports instead

t.C:10:10: error: redefinition of 'data' with a different type: 'float' vs
'int'
          float data;
                ^
t.C:5:14: note: previous definition is here
void Foo(int data) {
             ^
1 error generated.

GCC says (if you comment for example 'C b;'):

t.ii: In function ‘void Foo(int)’:
t.ii:10:11: error: declaration of ‘float data’ shadows a parameter
     float data;
           ^~~~

note the testcase is also to be rejected when using int for the second
declaration and it is about re-defining, not about shadowing I believe.

Reply via email to