1
2 struct Test32NS1
3 {
4 template<class X>
5 struct Foo
6 {
7 X *v;
8 };
9
10 template<class X>
11 struct Bar
12 {
13 X *v;
14 };
15
16 };
17
18 struct Test32NS2
19 {
20 template<class X>
21 struct Foo
22 {
23 X *v;
24 };
25 };
26
27 template <template <class X> class Y, template <class X> class Z>
28 struct Test32
29 {
30 Y<int>* field;
31 };
32
33
test32a(Test32<Test32NS1::Foo,Test32NS1::Foo> arg)34 void test32a(Test32<Test32NS1::Foo, Test32NS1::Foo> arg)
35 {
36 }
37
test32b(Test32<Test32NS1::Foo,Test32NS1::Bar> arg)38 void test32b(Test32<Test32NS1::Foo, Test32NS1::Bar> arg)
39 {
40 }
41
test32c(Test32<Test32NS1::Foo,Test32NS2::Foo> arg)42 void test32c(Test32<Test32NS1::Foo, Test32NS2::Foo> arg)
43 {
44 }
45
test32d(Test32<Test32NS1::Foo,Test32NS2::Foo> arg1,Test32<Test32NS2::Foo,Test32NS1::Foo> arg2)46 void test32d(Test32<Test32NS1::Foo, Test32NS2::Foo> arg1, Test32<Test32NS2::Foo, Test32NS1::Foo> arg2)
47 {
48 }
49
50
51 class XXX
52 {
53 };
54 template <void (&Goo)(XXX*, XXX**), void (&Xoo)(XXX*, XXX**)>
55 struct Test33
56 {
57 };
58
test33a(XXX *,XXX **)59 void test33a(XXX*, XXX**){}
60
test33(XXX *,Test33<test33a,test33a> arg,XXX *)61 void test33(XXX*, Test33<test33a, test33a> arg, XXX*)
62 {
63 }
64
65 template <void (&Goo)(int)>
66 struct Test34
67 {
68 };
69
70 struct Test34A
71 {
72 static void foo(int);
73 };
74
foo(int)75 void Test34A::foo(int) {}
test34(Test34<Test34A::foo> arg)76 void test34(Test34<Test34A::foo> arg)
77 {
78 }
79
80 int test36= 36;
81
82 template <int& XREF>
83 struct Test37
84 {
85 };
86
87 struct Test37A
88 {
89 static int t38;
90 };
91
92 int Test37A::t38 = 42;
93
test37(Test37<test36> arg)94 void test37(Test37<test36> arg)
95 {
96 }
97
test38(Test37<Test37A::t38> arg)98 void test38(Test37<Test37A::t38> arg)
99 {
100 }
101
102 struct Test39
103 {
104 template <class X>
105 struct T39A
106 {
107 };
108 };
109
110 struct T39A
111 {
112 };
113
test39(Test39::T39A<::T39A>)114 void test39(Test39::T39A< ::T39A >)
115 {
116 }
117
118 #if 0 //only for g++ with -std=c++0x and Visual C++ >= 2013
119 #if defined(__GNUG__) || (defined(_MSC_VER) && _MSC_VER >= 1200)
120 template<class... VarArg> struct Test40
121 {
122 };
123
124 void test40(Test40<int, double, void> arg)
125 {
126 }
127 #endif
128
129
130 #endif
131
132
133 extern XXX const * const test41 = 0;
134
135 namespace Test42
136 {
137 extern XXX const * const test42 = 0;
138 }
139
140 int test43[4] = {1, 2, 3, 4};
141
test44()142 XXX const* const test44()
143 {
144 return new XXX;
145 }
146