Re: [V5] [C PATCH 2/4] c23: tag compatibility rules for enums

2023-12-19 Thread Joseph Myers
On Sun, 17 Dec 2023, Martin Uecker wrote: > diff --git a/gcc/testsuite/gcc.dg/c23-tag-enum-1.c > b/gcc/testsuite/gcc.dg/c23-tag-enum-1.c > new file mode 100644 > index 000..a81a5afc456 > --- /dev/null > +++ b/gcc/testsuite/gcc.dg/c23-tag-enum-1.c > +void test2(void) > +{ > + enum ee *a;

[V5] [C PATCH 2/4] c23: tag compatibility rules for enums

2023-12-17 Thread Martin Uecker
Allow redefinition of enum types and enumerators. Diagnose nested redefinitions including redefinitions in the enum specifier for enum types with fixed underlying type. gcc/c: * c-tree.h (c_parser_enum_specifier): Add parameter. * c-decl.cc (start_enum): Allow redefinition.

Re: [V4] [PATCH 2/4] c23: tag compatibility rules for enums

2023-12-14 Thread Joseph Myers
On Mon, 27 Nov 2023, Martin Uecker wrote: > + enum B : short { M = 1 } *y2e = &x2;/* { dg-warning "incompatible" > } */ This probably now needs to be dg-error because -Wincompatible-pointer-types is now an error by default. OK with that changed as needed (you may also need such a chan

[V4] [PATCH 2/4] c23: tag compatibility rules for enums

2023-11-27 Thread Martin Uecker
(only tests were changed) c23: tag compatibility rules for enums Allow redefinition of enum types and enumerators. Diagnose nested redefinitions including redefinitions in the enum specifier for enum types with fixed underlying type. gcc/c: * c-tree.h (c_parser_enum_specifier): Add p

Re: [PATCH 2/4] c23: tag compatibility rules for enums

2023-11-23 Thread Joseph Myers
On Thu, 16 Nov 2023, Martin Uecker wrote: > +enum tt { R = 2 } TT; > +enum tt { > + R = _Generic(&TT, enum tt*: 0, default: 2) > +}; > +// incomplete during construction > + > +enum A { B = 7 } y; > +enum A { B = 7 }; > + > +enum A { B = _Generic(&y, enum A*: 1, default: 7) }; I don't follow

[PATCH 2/4] c23: tag compatibility rules for enums

2023-11-16 Thread Martin Uecker
Allow redefinition of enum types and enumerators. Diagnose nested redefinitions including redefinitions in the enum specifier for enum types with fixed underlying type. gcc/c: * c-tree.h (c_parser_enum_specifier): Add parameter. * c-decl.cc (start_enum): Allow redefinition.