1 // PR c++/80562 2 // { dg-options -std=c++17 } 3 4 struct T { fooT5 constexpr auto foo() { return false; } 6 }; 7 8 template <class MustBeTemplate> bf(T t)9 constexpr auto bf(T t) { 10 if constexpr(t.foo()) { // { dg-error "constant expression" } 11 return false; 12 } 13 return true; 14 } 15