diff options
Diffstat (limited to 'test/SemaTemplate/instantiate-method.cpp')
-rw-r--r-- | test/SemaTemplate/instantiate-method.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/test/SemaTemplate/instantiate-method.cpp b/test/SemaTemplate/instantiate-method.cpp index df1e1d9..2351d88 100644 --- a/test/SemaTemplate/instantiate-method.cpp +++ b/test/SemaTemplate/instantiate-method.cpp @@ -84,6 +84,8 @@ int *a(A0<int> &x0, A1<int> &x1) { struct X0Base { int &f(); + int& g(int); + static double &g(double); }; template<typename T> @@ -92,9 +94,28 @@ struct X0 : X0Base { template<typename U> struct X1 : X0<U> { - int &f2() { return X0Base::f(); } + int &f2() { + // FIXME: We should be able to do this lookup and diagnose the error + // *despite* the fact that we can't decide the relationship yet. + return X0Base::f(); // expected-FIXME-error{{call to non-static member function without an object argument}} + } }; void test_X1(X1<int> x1i) { int &ir = x1i.f2(); } + +template<typename U> +struct X2 : X0Base, U { + int &f2() { return X0Base::f(); } +}; + +template<typename T> +struct X3 { + void test(T x) { + double& d1 = X0Base::g(x); + } +}; + + +template struct X3<double>; |