| 1 | // RUN: %clang_cc1 -verify -std=c++17 %s |
| 2 | |
| 3 | template<typename T> constexpr int f() { return T::value; } // expected-error {{'::'}} |
| 4 | template<bool B, typename T> void g(decltype(B ? f<T>() : 0)); |
| 5 | template<bool B, typename T> void g(...); |
| 6 | template<bool B, typename T> void h(decltype(int{B ? f<T>() : 0})); // expected-note {{instantiation of}} |
| 7 | template<bool B, typename T> void h(...); |
| 8 | void x() { |
| 9 | g<false, int>(0); // ok |
| 10 | g<true, int>(0); // ok |
| 11 | h<false, int>(0); // expected-note {{while substituting}} |
| 12 | } |
| 13 | |