https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117386
Bug ID: 117386
Summary: -funsigned-bitfields support for the C++ front-end
should be removed
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Keywords: accepts-invalid, internal-improvement
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pinskia at gcc dot gnu.org
Blocks: 94404
Target Milestone: ---
After https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#739 , it is
no longer implementation-defined if plain int is signed or unsigned (it was
accepted as DR).
Therefore the code handling -funsigned-bitfields should be disabled or at least
errored out with a pederror if turned on for C++.
The code currently does:
/* [class.bit]
It is implementation-defined whether a plain (neither
explicitly signed or unsigned) char, short, int, or long
bit-field is signed or unsigned.
Naturally, we extend this to long long as well. Note that
this does not include wchar_t. */
|| (bitfield && !flag_signed_bitfields
&& !signed_p
/* A typedef for plain `int' without `signed' can be
controlled just like plain `int', but a typedef for
`signed int' cannot be so controlled. */
&& !(typedef_decl
&& C_TYPEDEF_EXPLICITLY_SIGNED (typedef_decl))
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94404
[Bug 94404] [meta-bug] C++ core issues