PR c++/81917 - ICE with void_t and partial specialization.
[official-gcc.git] / gcc / testsuite / g++.dg / template / pr55843.C
blob04079ed11758735981cdf5066e169d8d9e8ca8f6
1 template< typename T > struct type_wrapper {
2 };
3 typedef char (&yes_tag)[2];
4 template<bool b> struct if_c {
5 };
6 template< typename T > struct has_type {
7   struct gcc_3_2_wknd {
8     template< typename U > static yes_tag test( type_wrapper<U> const volatile* // { dg-message "" }
9 , type_wrapper<typename U::type>* = 0 );
10   };
11   typedef type_wrapper<T> t_;
12   static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) == // { dg-message "" }
13 sizeof(yes_tag);
15 template <class K, class T, class=void> struct Get_type {
17 struct FT_tag {};
18 struct RT_tag {};
19 template <class K> struct Get_type<K, RT_tag, typename if_c<
20 !has_type<Get_type<K, FT_tag> >::value >::type> { }; // { dg-message "required" }
21 template <class K> struct Get_type<K, FT_tag, typename if_c<
22 !has_type<Get_type<K, RT_tag> >::value >::type> { };  // { dg-message "required" }
23 typedef Get_type<int, FT_tag>::type P;                // { dg-message "" }