Reproducer:
https://godbolt.org/z/KorssdanW
constexpr int foo(int i) {
switch (i) {
case 11 ... 12:
return 4;
case 0 ... 9:
return 3;
default:
return 7;
}
}
static_assert(foo(-1) == 7, "");
When the above program is compiled with option -fexperimental-new-constant-interpreter enabled, it fails. When the option is disabled, it succeeds as expected.