public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/55843] New: ICE after exceeding template instantiation depth
@ 2013-01-02 0:34 glisse at gcc dot gnu.org
0 siblings, 0 replies; only message in thread
From: glisse at gcc dot gnu.org @ 2013-01-02 0:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55843
Bug #: 55843
Summary: ICE after exceeding template instantiation depth
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Keywords: error-recovery, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: glisse@gcc.gnu.org
Hello,
the following code, compiled without any option, makes cc1plus segfault.
g++-4.7 has a slightly nicer "confused by earlier errors, bailing out".
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> { };
typedef Get_type<int, FT_tag>::type P;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-01-02 0:34 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-02 0:34 [Bug c++/55843] New: ICE after exceeding template instantiation depth glisse at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).