brintos

brintos / llvm-project-archived public Read only

0
0
Text · 506 B · 5145daf Raw
13 lines · cpp
1// RUN: %clang_cc1 -verify -std=c++17 %s2 3template<typename T> constexpr int f() { return T::value; } // expected-error {{'::'}}4template<bool B, typename T> void g(decltype(B ? f<T>() : 0));5template<bool B, typename T> void g(...);6template<bool B, typename T> void h(decltype(int{B ? f<T>() : 0})); // expected-note {{instantiation of}}7template<bool B, typename T> void h(...);8void x() {9  g<false, int>(0); // ok10  g<true, int>(0); // ok11  h<false, int>(0); // expected-note {{while substituting}}12}13