| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
|
| 3 |
// There should be no extra errors about missing 'template' keywords. |
| 4 |
struct B { |
| 5 |
template <typename T> |
| 6 |
int f(){}; |
| 7 |
} builder; // expected-note 2{{'builder' declared here}} |
| 8 |
|
| 9 |
auto a = bilder.f<int>(); // expected-error{{undeclared identifier 'bilder'; did you mean}} |
| 10 |
auto b = (*(&bilder+0)).f<int>(); // expected-error{{undeclared identifier 'bilder'; did you mean}} |
| 11 |
|
| 12 |
struct X { |
| 13 |
struct type {}; |
| 14 |
}; |
| 15 |
|
| 16 |
namespace PR48339 { |
| 17 |
struct S { |
| 18 |
template <typename T> static void g(typename T::type) {} // expected-note {{couldn't infer template argument 'T'}} |
| 19 |
template <typename T> void f() { g(typename T::type{}); } // expected-error {{no matching function for call to 'g'}} |
| 20 |
}; |
| 21 |
|
| 22 |
void f() { S{}.f<X>(); } // expected-note {{in instantiation of}} |
| 23 |
} |