https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107805
Bug ID: 107805 Summary: Spurious warning after redefinition of type Product: gcc Version: 12.2.1 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: fw at gcc dot gnu.org Target Milestone: --- With gcc-11.3.1-3.fc35.x86_64, this program typedef int t; typedef struct { double a; int b; } t; t x; produces: t.c:2:37: error: conflicting types for ‘t’; have ‘struct <anonymous>’ 2 | typedef struct { double a; int b; } t; | ^ t.c:1:13: note: previous declaration of ‘t’ with type ‘t’ {aka ‘int’} 1 | typedef int t; | ^ which is expected. But with gcc-12.2.1-3.fc38.x86_64, I get this instead: t.c:2:37: error: conflicting types for ‘t’; have ‘struct <anonymous>’ 2 | typedef struct { double a; int b; } t; | ^ t.c:1:13: note: previous declaration of ‘t’ with type ‘t’ {aka ‘int’} 1 | typedef int t; | ^ t.c:3:3: warning: type defaults to ‘int’ in declaration of ‘x’ [-Wimplicit-int] 3 | t x; | ^ Note the spurious warning. This causes problems with attempts to eliminate implicit int, so it would be nice to fix this.