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

            Bug ID: 60188
           Summary: [c++11] ICE with parameter pack in default template
                    parameter
           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 code snippet (compiled with "-std=c++11")
triggers an ICE since GCC 4.3.0:

===========================================================
struct A
{
  int i;
};

template<typename... T, int A::* = &T::i> void foo() {}

template void foo<A>();
===========================================================

bug.cc: In substitution of 'template<class ... T, int A::* <anonymous> > void
foo() [with T = {A}; int A::* <anonymous> = <missing>]':
bug.cc:8:22:   required from here
bug.cc:6:36: internal compiler error: in dependent_type_p, at cp/pt.c:20283
 template<typename... T, int A::* = &T::i> void foo() {}
                                    ^
0x5ff408 dependent_type_p(tree_node*)
        ../../gcc/gcc/cp/pt.c:20283
0x5ffbc0 dependent_scope_p(tree_node*)
        ../../gcc/gcc/cp/pt.c:20314
0x6321b4 tsubst_qualified_id
        ../../gcc/gcc/cp/pt.c:12263
0x609c4c tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:14134
0x6115c6 tsubst_expr
        ../../gcc/gcc/cp/pt.c:13812
0x61e39c tsubst_template_arg
        ../../gcc/gcc/cp/pt.c:9293
0x639b80 type_unification_real
        ../../gcc/gcc/cp/pt.c:16326
0x64260a fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
        ../../gcc/gcc/cp/pt.c:15671
0x6432ca get_bindings
        ../../gcc/gcc/cp/pt.c:18402
0x643dfe determine_specialization
        ../../gcc/gcc/cp/pt.c:1968
0x644f31 check_explicit_specialization(tree_node*, tree_node*, int, int)
        ../../gcc/gcc/cp/pt.c:2636
0x5516f1 grokfndecl
        ../../gcc/gcc/cp/decl.c:7724
0x5ebfc4 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ../../gcc/gcc/cp/decl.c:10798
0x6c9d5a cp_parser_explicit_instantiation
        ../../gcc/gcc/cp/parser.c:14111
0x6d3fef cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10956
0x6d2bb8 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6d445a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6d445a c_parse_file()
        ../../gcc/gcc/cp/parser.c:31536
0x7f37c3 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]

Reply via email to