annotate gcc/testsuite/g++.dg/template/partial13.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 // PR c++/45012
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 template <bool B, class T=void> struct enable_if;
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 template <class T>
kono
parents:
diff changeset
6 struct enable_if<true,T>
kono
parents:
diff changeset
7 {
kono
parents:
diff changeset
8 typedef T type;
kono
parents:
diff changeset
9 };
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 enum { RUNTIME = 0 };
kono
parents:
diff changeset
12 // it compiles with the previous line commented out and the next commented in
kono
parents:
diff changeset
13 // static const int RUNTIME=0;
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 template <class T, class U, class EN=void> struct foo;
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 template <template<int> class V, int M>
kono
parents:
diff changeset
18 struct foo<V<M>,V<M>, typename enable_if<M==RUNTIME||M==2>::type> {};
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 template <template<int> class V1, template<int> class V2, int M>
kono
parents:
diff changeset
21 struct foo<V1<M>,V2<M>, typename enable_if<M==RUNTIME||M==2>::type> {};
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 template <int M> struct bar {};
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 foo<bar<2>,bar<2> > x;