111
|
1 // Copyright (C) 2001 Free Software Foundation
|
|
2 // Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
|
|
3 // { dg-do run }
|
|
4
|
|
5 extern "C" void abort();
|
|
6
|
|
7 struct A
|
|
8 {
|
|
9 template <class T> class B {};
|
|
10 };
|
|
11
|
|
12 template <template <class> class TT, class T> struct X
|
|
13 {
|
|
14 TT<int> y;
|
|
15 T z;
|
|
16 int f() { return 0; }
|
|
17 };
|
|
18
|
|
19 template <class T> struct X<T::template B, T>
|
|
20 {
|
|
21 typename T::template B<int> y;
|
|
22 T z;
|
|
23 int f() { return 1; }
|
|
24 };
|
|
25
|
|
26 template <class T> struct C
|
|
27 {
|
|
28 X<T::template B, A> x;
|
|
29 };
|
|
30
|
|
31 int main()
|
|
32 {
|
|
33 C<A> c;
|
|
34 X<A::B, A> x1;
|
|
35 X<A::B, int> x2;
|
|
36 if (x1.f() != 1)
|
|
37 abort();
|
|
38 if (x2.f() != 0)
|
|
39 abort();
|
|
40 }
|