1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=i386-pc-win32 | FileCheck %s
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -fms-extensions -fdelayed-template-parsing -triple=x86_64-pc-win32 | FileCheck -check-prefix X64 %s
3f4a2713aSLionel Sambuc
4f4a2713aSLionel Sambuc template<typename T>
5f4a2713aSLionel Sambuc class Class {
6f4a2713aSLionel Sambuc public:
Class()7f4a2713aSLionel Sambuc Class() {}
8f4a2713aSLionel Sambuc };
9f4a2713aSLionel Sambuc
10f4a2713aSLionel Sambuc class Typename { };
11f4a2713aSLionel Sambuc
12f4a2713aSLionel Sambuc template<typename T>
13f4a2713aSLionel Sambuc class Nested { };
14f4a2713aSLionel Sambuc
15f4a2713aSLionel Sambuc template<bool flag>
16f4a2713aSLionel Sambuc class BoolTemplate {
17f4a2713aSLionel Sambuc public:
BoolTemplate()18f4a2713aSLionel Sambuc BoolTemplate() {}
19f4a2713aSLionel Sambuc };
20f4a2713aSLionel Sambuc
21f4a2713aSLionel Sambuc template<int param>
22f4a2713aSLionel Sambuc class IntTemplate {
23f4a2713aSLionel Sambuc public:
IntTemplate()24f4a2713aSLionel Sambuc IntTemplate() {}
25f4a2713aSLionel Sambuc };
26f4a2713aSLionel Sambuc
27*0a6a1f1dSLionel Sambuc template<unsigned param>
28*0a6a1f1dSLionel Sambuc class UnsignedIntTemplate {
29*0a6a1f1dSLionel Sambuc public:
UnsignedIntTemplate()30*0a6a1f1dSLionel Sambuc UnsignedIntTemplate() {}
31*0a6a1f1dSLionel Sambuc };
32*0a6a1f1dSLionel Sambuc
33*0a6a1f1dSLionel Sambuc template<long long param>
34*0a6a1f1dSLionel Sambuc class LongLongTemplate {
35*0a6a1f1dSLionel Sambuc public:
LongLongTemplate()36*0a6a1f1dSLionel Sambuc LongLongTemplate() {}
37*0a6a1f1dSLionel Sambuc };
38*0a6a1f1dSLionel Sambuc
39*0a6a1f1dSLionel Sambuc template<unsigned long long param>
40*0a6a1f1dSLionel Sambuc class UnsignedLongLongTemplate {
41*0a6a1f1dSLionel Sambuc public:
UnsignedLongLongTemplate()42*0a6a1f1dSLionel Sambuc UnsignedLongLongTemplate() {}
43*0a6a1f1dSLionel Sambuc };
44*0a6a1f1dSLionel Sambuc
45f4a2713aSLionel Sambuc template<>
46f4a2713aSLionel Sambuc class BoolTemplate<true> {
47f4a2713aSLionel Sambuc public:
BoolTemplate()48f4a2713aSLionel Sambuc BoolTemplate() {}
Foo(T arg)49f4a2713aSLionel Sambuc template<class T> void Foo(T arg) {}
50f4a2713aSLionel Sambuc };
51f4a2713aSLionel Sambuc
template_mangling()52f4a2713aSLionel Sambuc void template_mangling() {
53f4a2713aSLionel Sambuc Class<Typename> c1;
54f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@VTypename@@@@QAE@XZ"
55f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@VTypename@@@@QEAA@XZ"
56f4a2713aSLionel Sambuc
57f4a2713aSLionel Sambuc Class<const Typename> c1_const;
58f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$CBVTypename@@@@QAE@XZ"
59f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$CBVTypename@@@@QEAA@XZ"
60f4a2713aSLionel Sambuc Class<volatile Typename> c1_volatile;
61f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$CCVTypename@@@@QAE@XZ"
62f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$CCVTypename@@@@QEAA@XZ"
63f4a2713aSLionel Sambuc Class<const volatile Typename> c1_cv;
64f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$CDVTypename@@@@QAE@XZ"
65f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$CDVTypename@@@@QEAA@XZ"
66f4a2713aSLionel Sambuc
67f4a2713aSLionel Sambuc Class<Nested<Typename> > c2;
68f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@V?$Nested@VTypename@@@@@@QAE@XZ"
69f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@V?$Nested@VTypename@@@@@@QEAA@XZ"
70f4a2713aSLionel Sambuc
71f4a2713aSLionel Sambuc Class<int * const> c_intpc;
72f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@QAH@@QAE@XZ"
73f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@QEAH@@QEAA@XZ"
74f4a2713aSLionel Sambuc Class<int()> c_ft;
75f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$A6AHXZ@@QAE@XZ"
76f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$A6AHXZ@@QEAA@XZ"
77f4a2713aSLionel Sambuc Class<int[]> c_inti;
78f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$BY0A@H@@QAE@XZ"
79f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$BY0A@H@@QEAA@XZ"
80f4a2713aSLionel Sambuc Class<int[5]> c_int5;
81f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$BY04H@@QAE@XZ"
82f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$BY04H@@QEAA@XZ"
83f4a2713aSLionel Sambuc Class<const int[5]> c_intc5;
84f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$BY04$$CBH@@QAE@XZ"
85f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$BY04$$CBH@@QEAA@XZ"
86f4a2713aSLionel Sambuc Class<int * const[5]> c_intpc5;
87f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$Class@$$BY04QAH@@QAE@XZ"
88f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$Class@$$BY04QEAH@@QEAA@XZ"
89f4a2713aSLionel Sambuc
90f4a2713aSLionel Sambuc BoolTemplate<false> _false;
91f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$BoolTemplate@$0A@@@QAE@XZ"
92f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$BoolTemplate@$0A@@@QEAA@XZ"
93f4a2713aSLionel Sambuc
94f4a2713aSLionel Sambuc BoolTemplate<true> _true;
95f4a2713aSLionel Sambuc // PR13158
96f4a2713aSLionel Sambuc _true.Foo(1);
97f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$BoolTemplate@$00@@QAE@XZ"
98f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$BoolTemplate@$00@@QEAA@XZ"
99f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QAEXH@Z"
100f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??$Foo@H@?$BoolTemplate@$00@@QEAAXH@Z"
101f4a2713aSLionel Sambuc
102f4a2713aSLionel Sambuc IntTemplate<0> zero;
103f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0A@@@QAE@XZ"
104f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0A@@@QEAA@XZ"
105f4a2713aSLionel Sambuc
106f4a2713aSLionel Sambuc IntTemplate<5> five;
107f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$04@@QAE@XZ"
108f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$04@@QEAA@XZ"
109f4a2713aSLionel Sambuc
110f4a2713aSLionel Sambuc IntTemplate<11> eleven;
111f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QAE@XZ"
112f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0L@@@QEAA@XZ"
113f4a2713aSLionel Sambuc
114f4a2713aSLionel Sambuc IntTemplate<256> _256;
115f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0BAA@@@QAE@XZ"
116f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0BAA@@@QEAA@XZ"
117f4a2713aSLionel Sambuc
118f4a2713aSLionel Sambuc IntTemplate<513> _513;
119f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0CAB@@@QAE@XZ"
120f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0CAB@@@QEAA@XZ"
121f4a2713aSLionel Sambuc
122f4a2713aSLionel Sambuc IntTemplate<1026> _1026;
123f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0EAC@@@QAE@XZ"
124f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0EAC@@@QEAA@XZ"
125f4a2713aSLionel Sambuc
126f4a2713aSLionel Sambuc IntTemplate<65535> ffff;
127f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0PPPP@@@QAE@XZ"
128f4a2713aSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0PPPP@@@QEAA@XZ"
129*0a6a1f1dSLionel Sambuc
130*0a6a1f1dSLionel Sambuc IntTemplate<-1> neg_1;
131*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?0@@QAE@XZ"
132*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0?0@@QEAA@XZ"
133*0a6a1f1dSLionel Sambuc IntTemplate<-9> neg_9;
134*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?8@@QAE@XZ"
135*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0?8@@QEAA@XZ"
136*0a6a1f1dSLionel Sambuc IntTemplate<-10> neg_10;
137*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?9@@QAE@XZ"
138*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0?9@@QEAA@XZ"
139*0a6a1f1dSLionel Sambuc IntTemplate<-11> neg_11;
140*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$IntTemplate@$0?L@@@QAE@XZ"
141*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$IntTemplate@$0?L@@@QEAA@XZ"
142*0a6a1f1dSLionel Sambuc
143*0a6a1f1dSLionel Sambuc UnsignedIntTemplate<4294967295> ffffffff;
144*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QAE@XZ"
145*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$UnsignedIntTemplate@$0PPPPPPPP@@@QEAA@XZ"
146*0a6a1f1dSLionel Sambuc
147*0a6a1f1dSLionel Sambuc LongLongTemplate<-9223372036854775807LL-1LL> int64_min;
148*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QAE@XZ"
149*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$LongLongTemplate@$0?IAAAAAAAAAAAAAAA@@@QEAA@XZ"
150*0a6a1f1dSLionel Sambuc LongLongTemplate<9223372036854775807LL> int64_max;
151*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QAE@XZ"
152*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$LongLongTemplate@$0HPPPPPPPPPPPPPPP@@@QEAA@XZ"
153*0a6a1f1dSLionel Sambuc UnsignedLongLongTemplate<18446744073709551615ULL> uint64_max;
154*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ"
155*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ"
156*0a6a1f1dSLionel Sambuc UnsignedLongLongTemplate<(unsigned long long)-1> uint64_neg_1;
157*0a6a1f1dSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QAE@XZ"
158*0a6a1f1dSLionel Sambuc // X64: call {{.*}} @"\01??0?$UnsignedLongLongTemplate@$0?0@@QEAA@XZ"
159f4a2713aSLionel Sambuc }
160f4a2713aSLionel Sambuc
161f4a2713aSLionel Sambuc namespace space {
foo(const T & l)162f4a2713aSLionel Sambuc template<class T> const T& foo(const T& l) { return l; }
163f4a2713aSLionel Sambuc }
164f4a2713aSLionel Sambuc // CHECK: "\01??$foo@H@space@@YAABHABH@Z"
165f4a2713aSLionel Sambuc // X64: "\01??$foo@H@space@@YAAEBHAEBH@Z"
166f4a2713aSLionel Sambuc
use()167f4a2713aSLionel Sambuc void use() {
168f4a2713aSLionel Sambuc space::foo(42);
169f4a2713aSLionel Sambuc }
170f4a2713aSLionel Sambuc
171f4a2713aSLionel Sambuc // PR13455
172f4a2713aSLionel Sambuc typedef void (*FunctionPointer)(void);
173f4a2713aSLionel Sambuc
174f4a2713aSLionel Sambuc template <FunctionPointer function>
FunctionPointerTemplate()175f4a2713aSLionel Sambuc void FunctionPointerTemplate() {
176f4a2713aSLionel Sambuc function();
177f4a2713aSLionel Sambuc }
178f4a2713aSLionel Sambuc
spam()179f4a2713aSLionel Sambuc void spam() {
180f4a2713aSLionel Sambuc FunctionPointerTemplate<spam>();
181f4a2713aSLionel Sambuc // CHECK: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ"
182f4a2713aSLionel Sambuc // X64: "\01??$FunctionPointerTemplate@$1?spam@@YAXXZ@@YAXXZ"
183f4a2713aSLionel Sambuc }
184f4a2713aSLionel Sambuc
185f4a2713aSLionel Sambuc // Unlike Itanium, there is no character code to indicate an argument pack.
186f4a2713aSLionel Sambuc // Tested with MSVC 2013, the first version which supports variadic templates.
187f4a2713aSLionel Sambuc
variadic_fn_template(const Ts &...args)188f4a2713aSLionel Sambuc template <typename ...Ts> void variadic_fn_template(const Ts &...args) { }
variadic_fn_instantiate()189f4a2713aSLionel Sambuc void variadic_fn_instantiate() {
190f4a2713aSLionel Sambuc variadic_fn_template(0, 1, 3, 4);
191f4a2713aSLionel Sambuc variadic_fn_template(0, 1, 'a', "b");
192f4a2713aSLionel Sambuc }
193f4a2713aSLionel Sambuc // CHECK: "\01??$variadic_fn_template@HHHH@@YAXABH000@Z"
194f4a2713aSLionel Sambuc // CHECK: "\01??$variadic_fn_template@HHD$$BY01D@@YAXABH0ABDAAY01$$CBD@Z"
195f4a2713aSLionel Sambuc
196f4a2713aSLionel Sambuc template <typename ...Ts>
197f4a2713aSLionel Sambuc struct VariadicClass {
VariadicClassVariadicClass198f4a2713aSLionel Sambuc VariadicClass() { }
199f4a2713aSLionel Sambuc int x;
200f4a2713aSLionel Sambuc };
variadic_class_instantiate()201f4a2713aSLionel Sambuc void variadic_class_instantiate() {
202f4a2713aSLionel Sambuc VariadicClass<int, char, bool> a;
203f4a2713aSLionel Sambuc VariadicClass<bool, char, int> b;
204f4a2713aSLionel Sambuc }
205f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$VariadicClass@HD_N@@QAE@XZ"
206f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01??0?$VariadicClass@_NDH@@QAE@XZ"
207f4a2713aSLionel Sambuc
208f4a2713aSLionel Sambuc template <typename T>
209f4a2713aSLionel Sambuc struct Second {};
210f4a2713aSLionel Sambuc
211f4a2713aSLionel Sambuc template <typename T, template <class> class>
212f4a2713aSLionel Sambuc struct Type {};
213f4a2713aSLionel Sambuc
214f4a2713aSLionel Sambuc template <template <class> class T>
215f4a2713aSLionel Sambuc struct Type2 {};
216f4a2713aSLionel Sambuc
217f4a2713aSLionel Sambuc template <template <class> class T, bool B>
218f4a2713aSLionel Sambuc struct Thing;
219f4a2713aSLionel Sambuc
220f4a2713aSLionel Sambuc template <template <class> class T>
221f4a2713aSLionel Sambuc struct Thing<T, false> { };
222f4a2713aSLionel Sambuc
223f4a2713aSLionel Sambuc template <template <class> class T>
224f4a2713aSLionel Sambuc struct Thing<T, true> { };
225f4a2713aSLionel Sambuc
template_template_fun(Type<Thing<Second,true>,Second>)226f4a2713aSLionel Sambuc void template_template_fun(Type<Thing<Second, true>, Second>) { }
227f4a2713aSLionel Sambuc // CHECK: "\01?template_template_fun@@YAXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z"
228f4a2713aSLionel Sambuc
229f4a2713aSLionel Sambuc template <typename T>
230f4a2713aSLionel Sambuc void template_template_specialization();
231f4a2713aSLionel Sambuc
232f4a2713aSLionel Sambuc template <>
template_template_specialization()233f4a2713aSLionel Sambuc void template_template_specialization<void (Type<Thing<Second, true>, Second>)>() {
234f4a2713aSLionel Sambuc }
235f4a2713aSLionel Sambuc // CHECK: "\01??$template_template_specialization@$$A6AXU?$Type@U?$Thing@USecond@@$00@@USecond@@@@@Z@@YAXXZ"
236f4a2713aSLionel Sambuc
237f4a2713aSLionel Sambuc // PR16788
238f4a2713aSLionel Sambuc template <decltype(nullptr)> struct S1 {};
f(S1<nullptr>)239f4a2713aSLionel Sambuc void f(S1<nullptr>) {}
240f4a2713aSLionel Sambuc // CHECK: "\01?f@@YAXU?$S1@$0A@@@@Z"
241f4a2713aSLionel Sambuc
242f4a2713aSLionel Sambuc struct record {
243f4a2713aSLionel Sambuc int first;
244f4a2713aSLionel Sambuc int second;
245f4a2713aSLionel Sambuc };
246f4a2713aSLionel Sambuc template <const record &>
247f4a2713aSLionel Sambuc struct type1 {
248f4a2713aSLionel Sambuc };
249f4a2713aSLionel Sambuc extern const record inst;
recref(type1<inst>)250f4a2713aSLionel Sambuc void recref(type1<inst>) {}
251f4a2713aSLionel Sambuc // CHECK: "\01?recref@@YAXU?$type1@$E?inst@@3Urecord@@B@@@Z"
252f4a2713aSLionel Sambuc
253f4a2713aSLionel Sambuc struct _GUID {};
254f4a2713aSLionel Sambuc struct __declspec(uuid("{12345678-1234-1234-1234-1234567890aB}")) uuid;
255f4a2713aSLionel Sambuc
256f4a2713aSLionel Sambuc template <typename T, const _GUID *G = &__uuidof(T)>
257f4a2713aSLionel Sambuc struct UUIDType1 {};
258f4a2713aSLionel Sambuc
259f4a2713aSLionel Sambuc template <typename T, const _GUID &G = __uuidof(T)>
260f4a2713aSLionel Sambuc struct UUIDType2 {};
261f4a2713aSLionel Sambuc
fun(UUIDType1<uuid> a)262f4a2713aSLionel Sambuc void fun(UUIDType1<uuid> a) {}
263f4a2713aSLionel Sambuc // CHECK: "\01?fun@@YAXU?$UUIDType1@Uuuid@@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z"
fun(UUIDType2<uuid> b)264f4a2713aSLionel Sambuc void fun(UUIDType2<uuid> b) {}
265f4a2713aSLionel Sambuc // CHECK: "\01?fun@@YAXU?$UUIDType2@Uuuid@@$E?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@@Z"
266f4a2713aSLionel Sambuc
267f4a2713aSLionel Sambuc template <typename T> struct TypeWithFriendDefinition {
FunctionDefinedWithInjectedName(TypeWithFriendDefinition<T>)268f4a2713aSLionel Sambuc friend void FunctionDefinedWithInjectedName(TypeWithFriendDefinition<T>) {}
269f4a2713aSLionel Sambuc };
270f4a2713aSLionel Sambuc // CHECK: call {{.*}} @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z"
CallFunctionDefinedWithInjectedName()271f4a2713aSLionel Sambuc void CallFunctionDefinedWithInjectedName() {
272f4a2713aSLionel Sambuc FunctionDefinedWithInjectedName(TypeWithFriendDefinition<int>());
273f4a2713aSLionel Sambuc }
274f4a2713aSLionel Sambuc // CHECK: @"\01?FunctionDefinedWithInjectedName@@YAXU?$TypeWithFriendDefinition@H@@@Z"
275*0a6a1f1dSLionel Sambuc
276*0a6a1f1dSLionel Sambuc // We need to be able to feed GUIDs through a couple rounds of template
277*0a6a1f1dSLionel Sambuc // substitution.
278*0a6a1f1dSLionel Sambuc template <const _GUID *G>
279*0a6a1f1dSLionel Sambuc struct UUIDType3 {
fooUUIDType3280*0a6a1f1dSLionel Sambuc void foo() {}
281*0a6a1f1dSLionel Sambuc };
282*0a6a1f1dSLionel Sambuc template <const _GUID *G>
283*0a6a1f1dSLionel Sambuc struct UUIDType4 : UUIDType3<G> {
barUUIDType4284*0a6a1f1dSLionel Sambuc void bar() { UUIDType4::foo(); }
285*0a6a1f1dSLionel Sambuc };
286*0a6a1f1dSLionel Sambuc template struct UUIDType4<&__uuidof(uuid)>;
287*0a6a1f1dSLionel Sambuc // CHECK: "\01?bar@?$UUIDType4@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@QAEXXZ"
288*0a6a1f1dSLionel Sambuc // CHECK: "\01?foo@?$UUIDType3@$1?_GUID_12345678_1234_1234_1234_1234567890ab@@3U__s_GUID@@B@@QAEXXZ"
289