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

            Bug ID: 58632
           Summary: [4.8/4.9 Regression] ICE reusing template parameter
                    name as class name
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid line of code triggers an ICE since GCC 4.8.0:

=================================================
template<template<int> class A> class A {};
=================================================

bug.cc:1:39: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have template_template_parm in xref_basetypes,
at cp/decl.c:12220
 template<template<int> class A> class A {};
                                       ^
0xcd860a tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9176
0x560941 tree_check3
        ../../gcc/gcc/tree.h:2649
0x560941 xref_basetypes(tree_node*, tree_node*)
        ../../gcc/gcc/cp/decl.c:12220
0x63776f cp_parser_class_head
        ../../gcc/gcc/cp/parser.c:19541
0x63776f cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:18842
0x638230 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19111
0x638230 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14090
0x64d739 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11337
0x651dc3 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:22591
0x654be8 cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:22467
0x65c9d9 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10737
0x65b5aa cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10659
0x65ce76 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3939
0x65ce76 c_parse_file()
        ../../gcc/gcc/cp/parser.c:28911
0x7708b3 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]

Reply via email to