The following invalid code snippet triggers an ICE on the 4.1 branch
(introduced after 4.1.1) and mainline:

============================================
template<typename T> struct A
{
  typedef struct typename T::X X;
};

template<typename T> A<T>::X::X() {}
============================================

bug.cc:3: error: expected identifier before 'typename'
bug.cc:3: error: two or more data types in declaration of 'X'
bug.cc:6: error: ISO C++ forbids declaration of 'X' with no type
bug.cc:6: internal compiler error: in is_ancestor, at cp/name-lookup.c:2247
Please submit a full bug report, [etc.]

Probably related to PR27102.


-- 
           Summary: [4.1/4.2 regression] ICE on invalid typedef
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
 BugsThisDependsOn: 27102


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

Reply via email to