You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Disallow _BitInt as an underlying type for an enumeration
As mentioned in #69619, C23 6.7.2.2p5 explicitly prohibits using a
_BitInt as an underlying type to an enumeration. While we had this in
the _ExtInt implementation, the justification for that limitation in C
is compelling, so this is being removed to be compatible with the C23
standard.
Fixes: #69619
// expected-error@*:*{{'make_signed' is only compatible with non-bool integers and enum types, but was given 'bool'}}
4060
4049
{ using ExpectedError = __make_signed(UnscopedBool); }
@@ -4063,10 +4052,6 @@ void make_signed() {
4063
4052
// expected-error@*:*{{'make_signed' is only compatible with non-bool integers and enum types, but was given 'ScopedBool' whose underlying type is 'bool'}}
4064
4053
{ using ExpectedError = __make_signed(unsigned_BitInt(1)); }
4065
4054
// expected-error@*:*{{'make_signed' is only compatible with non-_BitInt(1) integers and enum types, but was given 'unsigned _BitInt(1)'}}
4066
-
{ using ExpectedError = __make_signed(UnscopedBit); }
4067
-
// expected-error@*:*{{'make_signed' is only compatible with non-_BitInt(1) integers and enum types, but was given 'UnscopedBit' whose underlying type is 'unsigned _BitInt(1)'}}
4068
-
{ using ExpectedError = __make_signed(ScopedBit); }
4069
-
// expected-error@*:*{{'make_signed' is only compatible with non-_BitInt(1) integers and enum types, but was given 'ScopedBit' whose underlying type is 'unsigned _BitInt(1)'}}
4070
4055
{ using ExpectedError = __make_signed(int[]); }
4071
4056
// expected-error@*:*{{'make_signed' is only compatible with non-bool integers and enum types, but was given 'int[]'}}
// expected-error@*:*{{'make_unsigned' is only compatible with non-bool integers and enum types, but was given 'bool'}}
4157
4137
{ using ExpectedError = __make_unsigned(UnscopedBool); }
@@ -4160,10 +4140,6 @@ void make_unsigned() {
4160
4140
// expected-error@*:*{{'make_unsigned' is only compatible with non-bool integers and enum types, but was given 'ScopedBool' whose underlying type is 'bool'}}
4161
4141
{ using ExpectedError = __make_unsigned(unsigned_BitInt(1)); }
4162
4142
// expected-error@*:*{{'make_unsigned' is only compatible with non-_BitInt(1) integers and enum types, but was given 'unsigned _BitInt(1)'}}
4163
-
{ using ExpectedError = __make_unsigned(UnscopedBit); }
4164
-
// expected-error@*:*{{'make_unsigned' is only compatible with non-_BitInt(1) integers and enum types, but was given 'UnscopedBit'}}
4165
-
{ using ExpectedError = __make_unsigned(ScopedBit); }
4166
-
// expected-error@*:*{{'make_unsigned' is only compatible with non-_BitInt(1) integers and enum types, but was given 'ScopedBit'}}
4167
4143
{ using ExpectedError = __make_unsigned(int[]); }
4168
4144
// expected-error@*:*{{'make_unsigned' is only compatible with non-bool integers and enum types, but was given 'int[]'}}
4169
4145
{ using ExpectedError = __make_unsigned(int[5]); }
0 commit comments