From: Paolo Carlini Date: Fri, 22 Jan 2016 11:03:54 +0000 (+0000) Subject: re PR c++/55843 (ICE after exceeding template instantiation depth) X-Git-Tag: basepoints/gcc-7~1397 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4696899f42bb40f21b99879542be04ce65cc0b33;p=thirdparty%2Fgcc.git re PR c++/55843 (ICE after exceeding template instantiation depth) 2016-01-22 Paolo Carlini PR c++/55843 * g++.dg/template/pr55843.C: New. From-SVN: r232721 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cdffd2413691..29a048df7ffa 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-01-22 Paolo Carlini + + PR c++/55843 + * g++.dg/template/pr55843.C: New. + 2016-01-22 Alan Lawrence PR testsuite/66877 diff --git a/gcc/testsuite/g++.dg/template/pr55843.C b/gcc/testsuite/g++.dg/template/pr55843.C new file mode 100644 index 000000000000..e1691d5a5b05 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr55843.C @@ -0,0 +1,27 @@ +// { dg-options "-ftemplate-depth-8" } + +template< typename T > struct type_wrapper { +}; +typedef char (&yes_tag)[2]; +template struct if_c { +}; +template< typename T > struct has_type { + struct gcc_3_2_wknd { + template< typename U > static yes_tag test( type_wrapper const volatile* +, type_wrapper* = 0 ); + }; + typedef type_wrapper t_; + static const bool value = sizeof(gcc_3_2_wknd::test(static_cast(0))) == +sizeof(yes_tag); +}; +template struct Get_type { +}; +struct FT_tag {}; +struct RT_tag {}; +template struct Get_type >::value >::type> { }; +template struct Get_type >::value >::type> { }; // { dg-error "depth" } +typedef Get_type::type P; + +// { dg-prune-output "compilation terminated" }