Commit 4696899f by Paolo Carlini Committed by Paolo Carlini

re PR c++/55843 (ICE after exceeding template instantiation depth)

2016-01-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/55843
	* g++.dg/template/pr55843.C: New.

From-SVN: r232721
parent bac69366
2016-01-22 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/55843
* g++.dg/template/pr55843.C: New.
2016-01-22 Alan Lawrence <alan.lawrence@arm.com> 2016-01-22 Alan Lawrence <alan.lawrence@arm.com>
PR testsuite/66877 PR testsuite/66877
......
// { dg-options "-ftemplate-depth-8" }
template< typename T > struct type_wrapper {
};
typedef char (&yes_tag)[2];
template<bool b> struct if_c {
};
template< typename T > struct has_type {
struct gcc_3_2_wknd {
template< typename U > static yes_tag test( type_wrapper<U> const volatile*
, type_wrapper<typename U::type>* = 0 );
};
typedef type_wrapper<T> t_;
static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<t_*>(0))) ==
sizeof(yes_tag);
};
template <class K, class T, class=void> struct Get_type {
};
struct FT_tag {};
struct RT_tag {};
template <class K> struct Get_type<K, RT_tag, typename if_c<
!has_type<Get_type<K, FT_tag> >::value >::type> { };
template <class K> struct Get_type<K, FT_tag, typename if_c<
!has_type<Get_type<K, RT_tag> >::value >::type> { }; // { dg-error "depth" }
typedef Get_type<int, FT_tag>::type P;
// { dg-prune-output "compilation terminated" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment