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 {
412412
413413def CheckEnumValue : Opcode {
414414 let Args = [ArgEnumDecl];
415- let Types = [FixedSizeIntegralTypeClass ];
415+ let Types = [IntegralTypeClass ];
416416 let HasGroup = 1 ;
417417}
418418
Original file line number Diff line number Diff line change @@ -292,7 +292,19 @@ constexpr int shifts() { // both-error {{never produces a constant expression}}
292292 (void )(2 << b); // ref-warning {{shift count is negative}}
293293 return 1 ;
294294}
295- #endif
296295
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
297309
298310#endif
You can’t perform that action at this time.
0 commit comments