Compiling the following invalid ocde snippet I get an ICE:

==============================
template<int> enum E { e };
==============================

bug.cc:1: error: template declaration of 'enum E'
bug.cc:1: internal compiler error: tree check: expected class 'declaration',
have 'exceptional' (error_mark) in pushdecl, at cp/name-lookup.c:641
Please submit a full bug report, [etc.]

The regression appeared with Kriang's patch
http://gcc.gnu.org/ml/gcc-cvs/2003-10/msg00781.html

Looks like some function cannot deal with the returned error_mark_node
in push_template_decl_real.

-- 
           Summary: [3.4/4.0 regression] ICE on templated enum
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,lerdsuwa at gcc dot gnu
                    dot org


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

Reply via email to