annotate gcc/testsuite/g++.dg/cpp0x/variadic9.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
2 template<typename T1, typename T2>
kono
parents:
diff changeset
3 struct pair {};
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 template<typename... Args>
kono
parents:
diff changeset
6 struct tuple {
kono
parents:
diff changeset
7 static const int value = 0;
kono
parents:
diff changeset
8 };
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 template<>
kono
parents:
diff changeset
11 struct tuple<pair<int, float> > {
kono
parents:
diff changeset
12 static const int value = 1;
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 template<typename U>
kono
parents:
diff changeset
16 struct tuple<pair<int, U> > {
kono
parents:
diff changeset
17 static const int value = 2;
kono
parents:
diff changeset
18 };
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 template<typename T, typename U>
kono
parents:
diff changeset
21 struct tuple<pair<T, U>, pair<T, U> > {
kono
parents:
diff changeset
22 static const int value = 3;
kono
parents:
diff changeset
23 };
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 template<typename... Outer>
kono
parents:
diff changeset
27 struct X {
kono
parents:
diff changeset
28 template<typename... Inner>
kono
parents:
diff changeset
29 struct Y
kono
parents:
diff changeset
30 {
kono
parents:
diff changeset
31 typedef tuple<pair<Outer, Inner>...> type;
kono
parents:
diff changeset
32 };
kono
parents:
diff changeset
33 };
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 int a0[X<int, double>::Y<short, char>::type::value == 0? 1 : -1];
kono
parents:
diff changeset
36 int a1[X<int>::Y<float>::type::value == 1? 1 : -1];
kono
parents:
diff changeset
37 int a2[X<int>::Y<double>::type::value == 2? 1 : -1];
kono
parents:
diff changeset
38 int a3[X<int, int>::Y<double, double>::type::value == 3? 1 : -1];