29 lines · cpp
1// RUN: %clang_cc1 -frecovery-ast -verify %s2 3bool Foo(int *); // expected-note 3{{candidate function not viable}}4 5template <typename T>6struct Crash : decltype(Foo(T())) { // expected-error {{no matching function for call to 'Foo'}}7 Crash(){};8};9 10void test() { Crash<int>(); } // expected-note {{in instantiation of template class}}11 12template <typename T>13using Alias = decltype(Foo(T())); // expected-error {{no matching function for call to 'Foo'}}14template <typename T>15struct Crash2 : decltype(Alias<T>()) { // expected-note {{in instantiation of template type alias 'Alias' requested here}}16 Crash2(){};17};18 19void test2() { Crash2<int>(); } // expected-note {{in instantiation of template class 'Crash2<int>' requested here}}20 21template <typename T>22class Base {};23template <typename T>24struct Crash3 : Base<decltype(Foo(T()))> { // expected-error {{no matching function for call to 'Foo'}}25 Crash3(){};26};27 28void test3() { Crash3<int>(); } // expected-note {{in instantiation of template class}}29