• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 template<typename T>
4 struct X {
5   template<typename U> struct Inner { };
6 
fX7   template<typename U> void f(T, U) { }
8 };
9 
10 template<> template<typename U>
11 struct X<int>::Inner {
12   U member;
13 };
14 
15 template<> template<typename U>
f(int x,U y)16 void X<int>::f(int x, U y) {
17   x = y; // expected-error{{incompatible type}}
18 }
19 
test(X<int> xi,X<long> xl,float * fp)20 void test(X<int> xi, X<long> xl, float *fp) {
21   X<int>::Inner<float*> xii;
22   xii.member = fp;
23   xi.f(17, 25);
24   xi.f(17, 3.14159);
25   xi.f(17, fp); // expected-note{{instantiation}}
26   X<long>::Inner<float*> xli;
27 
28   xli.member = fp; // expected-error{{no member}}
29   xl.f(17, fp); // okay
30 }
31