The following invalid code snippet causes an ICE since GCC 3.3:

==============================================
template<int> struct A
{
  void foo();
};

template<int N, char> void A<N>::foo() {}

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

bug.cc:6: error: got 2 template parameters for `void A<<anonymous> >::foo()'
bug.cc:6: error:   but 1 required
bug.cc: In instantiation of `A<0>':
bug.cc:8:   instantiated from here
bug.cc:6: internal compiler error: tree check: accessed elt 2 of tree_vec with 
   1 elts in tsubst, at cp/pt.c:6707
Please submit a full bug report, [etc.]

-- 
           Summary: [3.4/4.0/4.1 regression] ICE with wrong number of
                    template parameters
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, monitored, ice-
                    checking
          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


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

Reply via email to