diff options
Diffstat (limited to 'test/SemaTemplate/member-function-template.cpp')
| -rw-r--r-- | test/SemaTemplate/member-function-template.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/SemaTemplate/member-function-template.cpp b/test/SemaTemplate/member-function-template.cpp index 83bf16c69004..1d46d31e35d3 100644 --- a/test/SemaTemplate/member-function-template.cpp +++ b/test/SemaTemplate/member-function-template.cpp @@ -49,3 +49,27 @@ void test_X_f0_explicit(X x, int i, long l) { // PR4608 class A { template <class x> x a(x z) { return z+y; } int y; }; +// PR5419 +struct Functor { + template <typename T> + bool operator()(const T& v) const { + return true; + } +}; + +void test_Functor(Functor f) { + f(1); +} + +// Instantiation on -> +template<typename T> +struct X1 { + template<typename U> U& get(); +}; + +template<typename T> struct X2; // expected-note{{here}} + +void test_incomplete_access(X1<int> *x1, X2<int> *x2) { + float &fr = x1->get<float>(); + (void)x2->get<float>(); // expected-error{{implicit instantiation of undefined template}} +} |
