On Thu, 28 May 2026, Jakub Jelinek wrote: > On Wed, May 27, 2026 at 08:47:50PM +0000, Joseph Myers wrote: > > On Wed, 27 May 2026, Jakub Jelinek wrote: > > > > > On Wed, May 27, 2026 at 08:29:51PM +0000, Joseph Myers wrote: > > > > I think there should be a testcase that bit-fields of bit-precise enum > > > > type get promoted to their declared type by the integer promotions, > > > > like > > > > _BitInt bit-fields do. (And then from the enum type to the underlying > > > > bit-precise type - conversion to the underlying type is what GCC does > > > > with > > > > enums in the integer promotions and is the expressed preference of WG14 > > > > in > > > > C23 issue 1021 for what should be done with enums in integer promotions > > > > in > > > > general.) > > > > > > I even started adding those when writing the patch, but then gave up > > > because > > > _Generic on the bit-fields themselves gives unpromoted types. > > > So, for testing this, shall I test using _Generic (object.bit_field + 0wb, > > > ...) or something similar (or _Generic (+object.bit_field, ...))? > > > > Yes, something like that. I think bitint-17.c has the corresponding tests > > for bit-fields declared with _BitInt. > > Ah, ok. > So then something like the following incremental patch?
Yes, like that. > Will incorporate into the full patch when testing succeeds. > > Note, haven't tweaked the handling of non-_BitInt enums for issue 1021, > I think such a change shouldn't be in mostly unrelated patch. Note the > issue 1021 proposed resolution doesn't take into account the N3705 changes > to the same spot. Issue resolutions are generally expressed relative to C23, since the issue tracking process is for issues in released standard versions, though occasionally they may need different wording to be given for C2Y because of interactions with changes there. In this case, the proposed new wording is designed to work after N3705 as well, though the deleted text shown is the C23 text. -- Joseph S. Myers [email protected]
