File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ def CheckDecl : Opcode {
412
412
413
413
def CheckEnumValue : Opcode {
414
414
let Args = [ArgEnumDecl];
415
- let Types = [FixedSizeIntegralTypeClass ];
415
+ let Types = [IntegralTypeClass ];
416
416
let HasGroup = 1 ;
417
417
}
418
418
Original file line number Diff line number Diff line change @@ -292,7 +292,19 @@ constexpr int shifts() { // both-error {{never produces a constant expression}}
292
292
(void )(2 << b); // ref-warning {{shift count is negative}}
293
293
return 1 ;
294
294
}
295
- #endif
296
295
296
+ namespace UnderlyingInt128 {
297
+ enum F {
298
+ a = (__int128)-1
299
+ };
300
+
301
+ constexpr int foo () { // both-error {{never produces a constant expression}}
302
+ F f = (F)(__int128)10 ; // both-note 2{{integer value 10 is outside the valid range of values [-1, 0] for the enumeration type 'F'}}
303
+ return (int )f;
304
+ }
305
+ static_assert (foo() == 0 , " " ); // both-error {{not an integral constant expression}} \
306
+ // both-note {{in call to}}
307
+ }
308
+ #endif
297
309
298
310
#endif
You can’t perform that action at this time.
0 commit comments