libstdc++: [_Hashtable] Fix some implementation inconsistencies
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-52830a.C
blob224f2cd50eb8031597343e097c71bd4a58d019de
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.
7 template<bool b> struct eif { typedef void type; };
8 template<>       struct eif<false> {};
10 template<class A, class B> struct same
12   static constexpr bool value = false;
14 template<class A>
15 struct same<A, A>
17   static constexpr bool value = true;
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);
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 * )
35 void do_stuff()
37   foo f;
38   f.func(12);