The following invalid code snippet triggers an ICE since GCC 4.0.0:

=========================================
template<int> struct A
{
    int& i;
    A();
    ~A() { &A::i; }
};

A<0> a;
=========================================

bug.cc: In destructor 'A<<anonymous> >::~A() [with int <anonymous> = 0]':
bug.cc:9:   instantiated from here
bug.cc:6: internal compiler error: in gimplify_expr, at gimplify.c:5763
Please submit a full bug report, [etc.]

Before we got the error message:

bug.cc: In destructor `void A<<anonymous> >::A() [with int <anonymous> = 0]':
bug.cc:9:   instantiated from here
bug.cc:6: cannot create pointer to reference member `A<0>::i'


-- 
           Summary: [4.0/4.1/4.2 regression] ICE creating pointer-to-
                    reference-member
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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

Reply via email to