[Bug c++/55581] Too-eager instantiation

dave at boostpro dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 4 19:30:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55581

--- Comment #1 from Dave Abrahams <dave at boostpro dot com> 2012-12-04 19:30:40 UTC ---
Actually, here's a simpler test case:


template <long N>
struct mooch
{
    mooch<N-1> operator->();
};

template <>
struct mooch<0>
{
    int x;

    mooch<0>* operator->();
};

mooch<100000> a;             // compiles with depth 1
decltype(a.operator->()) y;   // compiles with depth 1
decltype(a->x) z;                 // BOOM



More information about the Gcc-bugs mailing list