https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128335
Bug ID: 128335
Summary: [15/16/17 Regression] Incorrect type of enumeration
constant in redeclaration of enumeration constant,
again
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: luigighiron at gmail dot com
Target Milestone: ---
The following code is incorrectly rejected by GCC:
enum E{A=1,B=_Generic(A,int:-1U,default:1U)};
enum E{A=1,B=_Generic(A,int:-1U,default:1U)};
See also PR115109, the type of A in the redeclaration should be int as that is
the type the enumeration constant had previously. This is a regression since
the behavior was correct in 14 when the value was representable in int.