The following invalid code snippet triggers an ICE on mainline:

=============================================
namespace N {}

template<typename> struct A
{
  int A<typename N::X>;
};
=============================================

bug.cc:5: error: 'X' in namespace 'N' does not name a type
bug.cc:5: error: template argument 1 is invalid
bug.cc:5: error: expected `::' before ';' token
bug.cc:5: error: expected `*' before ';' token
bug.cc:5: error: expected unqualified-id before ';' token
bug.cc:5: internal compiler error: in cp_parser_make_indirect_declarator, at
cp/parser.c:2714
Please submit a full bug report, [etc.]

The regression was introduced between 2007-05-26 and 2007-06-07,
probably by the patch

2007-05-30  Russell Yanofsky <[EMAIL PROTECTED]>
            Douglas Gregor <[EMAIL PROTECTED]>
            Pedro Lamarao <[EMAIL PROTECTED]>
            Howard Hinnant <[EMAIL PROTECTED]>

        PR c++/7412
        PR c++/29939
        ...
        (cp_parser_make_indirect_declarator): New.
        ...


-- 
           Summary: [4.3 regression] ICE on invalid declaration in template
           Product: gcc
           Version: 4.3.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


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

Reply via email to