[Bug c/79983] New: Improve enum and struct redefinition diagnostic
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 9 18:59:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79983
Bug ID: 79983
Summary: Improve enum and struct redefinition diagnostic
Product: gcc
Version: 7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
As discussed here <https://gcc.gnu.org/ml/gcc-patches/2017-03/msg00438.html>
we should do better enum/struct redefinition.
Here
enum E;
enum E { A, B, C };
enum E { D, F };
and here
struct S;
struct S { int i; };
struct S { int i, j; };
gcc gives suboptimal
ll.c:3:8: error: redefinition of ‘struct S’
struct S { int i, j; };
^
ll.c:1:8: note: originally defined here
struct S;
^
while clang gets it right:
ll.c:3:8: error: redefinition of 'S'
struct S { int i, j; };
^
ll.c:2:8: note: previous definition is here
struct S { int i; };
^
More information about the Gcc-bugs
mailing list