1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// PR c++/51912 // { dg-do compile { target c++11 } } constexpr double g() { return 2.0; } void f(int i) { switch (i) { case 1.0:; // { dg-error "could not convert" } } switch (i) { case g():; // { dg-error "could not convert" } } }