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