Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-52830a.C

raw
1 // PR c++/52830
2 // { dg-do compile { target c++11 } }
3 // { dg-additional-options "-fchecking" }
4 // A version of constexpr-52830.C that uses an intermediate template template
5 // parameter.
6
7 template<bool b> struct eif { typedef void type; };
8 template<> struct eif<false> {};
9
10 template<class A, class B> struct same
11 {
12 static constexpr bool value = false;
13 };
14 template<class A>
15 struct same<A, A>
16 {
17 static constexpr bool value = true;
18 };
19
20
21 struct foo {
22 template<class T, template<class, class> class SAME = same>
23 void func(T && a,
24 typename eif<SAME<decltype(a), int&&>::value>::type * = 0);
25 };
26
27 template<class T, template<class, class> class SAME>
28 void
29 foo::
30 func(T && a,
31 typename eif<SAME<decltype(a), int&&>::value>::type * )
32 {
33 }
34
35 void do_stuff()
36 {
37 foo f;
38 f.func(12);
39 }