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

           Summary: ICE: "Error reporting routines re-entered"
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: zeratul...@hotmail.com


For the following code:

struct A
{
    template <typename T>
    struct B
    {
    };

    template <typename T>
    B<T> f(T t)
    {
        return B<T>();
    }
};

template <typename T>
auto g(T t) -> decltype(A().f(t))
{
    return A().f(t);
}

template <typename S>
class C
{
    struct D
    {
    };
    D d;
public:
    decltype(g(d)) h() 
    {
        return g(d);
    }
};

void g()
{
    C<int> c;
    c.h();
}


Both gcc 4.5 and 4.6 give the following error:

test.cpp: In instantiation of ‘decltype (A().A::B<T> A::f(t))
     g(T) [with T = C<int>::D, decltype (A().A::f(t)) = A::B<C<int>::D>]’:

Internal compiler error: Error reporting routines re-entered.

As far as I can tell, this is valid C++0x code.

Reply via email to