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

            Bug ID: 60374
           Summary: [4.7/4.8/4.9 Regression] ICE with invalid template
                    specialization
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid testcase (compiled with "-std=c++11") triggers
an ICE since GCC 4.7.0:

===============================================
template<typename> struct A {};

template<typename...T> struct A<T::T...> {};

A<int> a;
===============================================

bug.cc:3:31: error: template argument 'T:: T' involves template parameter(s)
 template<typename...T> struct A<T::T...> {};
                               ^
bug.cc:5:8: internal compiler error: in unify_one_argument, at cp/pt.c:16311
 A<int> a;
        ^
0x63a5ec unify_one_argument
        ../../gcc/gcc/cp/pt.c:16310
0x63b430 unify_pack_expansion
        ../../gcc/gcc/cp/pt.c:17129
0x6389de unify
        ../../gcc/gcc/cp/pt.c:17884
0x63e6ff get_class_bindings
        ../../gcc/gcc/cp/pt.c:18610
0x63f37e most_specialized_class
        ../../gcc/gcc/cp/pt.c:18852
0x64ecf9 instantiate_class_template_1
        ../../gcc/gcc/cp/pt.c:8867
0x64ecf9 instantiate_class_template(tree_node*)
        ../../gcc/gcc/cp/pt.c:9399
0x6e1d83 complete_type(tree_node*)
        ../../gcc/gcc/cp/typeck.c:134
0x5c8e58 start_decl_1(tree_node*, bool)
        ../../gcc/gcc/cp/decl.c:4719
0x5f1ef7 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/gcc/cp/decl.c:4682
0x6ce2be cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16684
0x6cfd49 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11205
0x6b3003 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6da2d2 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10983
0x6d8fc8 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6da87a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6da87a c_parse_file()
        ../../gcc/gcc/cp/parser.c:31590
0x7f9fe3 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]

Reply via email to