1// Named type parameter pack.
2template <typename... Is>
3struct TypePack { int a; };
4TypePack<> emptyTypePack;
5TypePack<int> oneElemTypePack;
6TypePack<int, float> twoElemTypePack;
7
8// Unnamed type parameter pack.
9template <typename... >
10struct AnonTypePack { int b; };
11AnonTypePack<> emptyAnonTypePack;
12AnonTypePack<int> oneElemAnonTypePack;
13AnonTypePack<int, float> twoElemAnonTypePack;
14
15// Test type parameter packs combined with non-pack type template parameters.
16
17// Unnamed type parameter pack behind a named type parameter.
18template <typename T, typename... >
19struct AnonTypePackAfterTypeParam { T c; };
20AnonTypePackAfterTypeParam<int> emptyAnonTypePackAfterTypeParam;
21AnonTypePackAfterTypeParam<int, float> oneElemAnonTypePackAfterTypeParam;
22
23// Unnamed type parameter pack behind an unnamed type parameter.
24template <typename, typename... >
25struct AnonTypePackAfterAnonTypeParam { float d; };
26AnonTypePackAfterAnonTypeParam<int> emptyAnonTypePackAfterAnonTypeParam;
27AnonTypePackAfterAnonTypeParam<int, float> oneElemAnonTypePackAfterAnonTypeParam;
28
29// Named type parameter pack behind an unnamed type parameter.
30template <typename, typename... Ts>
31struct TypePackAfterAnonTypeParam { int e; };
32TypePackAfterAnonTypeParam<int> emptyTypePackAfterAnonTypeParam;
33TypePackAfterAnonTypeParam<int, float> oneElemTypePackAfterAnonTypeParam;
34
35// Named type parameter pack behind a named type parameter.
36template <typename T, typename... Ts>
37struct TypePackAfterTypeParam { int f; };
38TypePackAfterTypeParam<int> emptyTypePackAfterTypeParam;
39TypePackAfterTypeParam<int, float> oneElemTypePackAfterTypeParam;
40
41// Test type parameter packs combined with non-pack non-type template parameters.
42
43// Unnamed type parameter pack behind a named type parameter.
44template <int I, typename... >
45struct AnonTypePackAfterNonTypeParam { int g; };
46AnonTypePackAfterNonTypeParam<1> emptyAnonTypePackAfterNonTypeParam;
47AnonTypePackAfterNonTypeParam<1, int> oneElemAnonTypePackAfterNonTypeParam;
48
49// Unnamed type parameter pack behind an unnamed type parameter.
50template <int, typename... >
51struct AnonTypePackAfterAnonNonTypeParam { float h; };
52AnonTypePackAfterAnonNonTypeParam<1> emptyAnonTypePackAfterAnonNonTypeParam;
53AnonTypePackAfterAnonNonTypeParam<1, int> oneElemAnonTypePackAfterAnonNonTypeParam;
54
55// Named type parameter pack behind an unnamed type parameter.
56template <int, typename... Ts>
57struct TypePackAfterAnonNonTypeParam { int i; };
58TypePackAfterAnonNonTypeParam<1> emptyTypePackAfterAnonNonTypeParam;
59TypePackAfterAnonNonTypeParam<1, int> oneElemTypePackAfterAnonNonTypeParam;
60
61// Named type parameter pack behind an unnamed type parameter.
62template <int I, typename... Ts>
63struct TypePackAfterNonTypeParam { int j; };
64TypePackAfterNonTypeParam<1> emptyTypePackAfterNonTypeParam;
65TypePackAfterNonTypeParam<1, int> oneElemTypePackAfterNonTypeParam;
66
67int main() {
68 return 0; // break here
69}
70

source code of lldb/test/API/lang/cpp/class-template-type-parameter-pack/main.cpp