• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 template<typename T, typename U>
4 struct X0 {
5   struct Inner;
6 };
7 
8 template<typename T, typename U>
9 struct X0<T, U>::Inner {
10   T x;
11   U y;
12 
fX0::Inner13   void f() { x = y; } // expected-error{{incompatible}}
14 };
15 
16 
test(int i,float f)17 void test(int i, float f) {
18   X0<int, float>::Inner inner;
19   inner.x = 5;
20   inner.y = 3.4;
21   inner.f();
22 
23   X0<int*, float *>::Inner inner2;
24   inner2.x = &i;
25   inner2.y = &f;
26   inner2.f(); // expected-note{{instantiation}}
27 }
28