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

            Bug ID: 60312
           Summary: [4.9 Regression] [c++1y] ICE using auto as template
                    parameter
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: 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 code snippet (compiled with "-std=c++1y") triggers an
ICE on trunk:

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

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

void bar()
{
  A<auto>().foo<0>();
}
==================================

bug.cc: In substitution of 'template<int <anonymous> > void A<auto>::foo()
[with int <anonymous> = 0]':
bug.cc:10:20:   required from here
bug.cc:5:22: internal compiler error: in tsubst, at cp/pt.c:11554
   template<int> void foo();
                      ^
0x621ff5 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:11554
0x62cb32 tsubst_template_args
        ../../gcc/gcc/cp/pt.c:9837
0x62d5c3 tsubst_aggr_type
        ../../gcc/gcc/cp/pt.c:10034
0x61f961 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:11445
0x61f1cb tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:11435
0x62b376 tsubst_arg_types
        ../../gcc/gcc/cp/pt.c:11091
0x62b77b tsubst_function_type
        ../../gcc/gcc/cp/pt.c:11190
0x61f85a tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:11903
0x646550 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:15633
0x5b1941 add_template_candidate_real
        ../../gcc/gcc/cp/call.c:2974
0x5ad5ec add_template_candidate
        ../../gcc/gcc/cp/call.c:3071
0x5ad5ec add_candidates
        ../../gcc/gcc/cp/call.c:5132
0x5b71ae build_new_method_call_1
        ../../gcc/gcc/cp/call.c:7772
0x5b71ae build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
        ../../gcc/gcc/cp/call.c:7958
0x6b6f09 cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:6135
0x6b9286 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:7170
0x6b9faf cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:7874
0x6ba4a1 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:8112
0x6bc854 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8274
0x6bd08c cp_parser_expression
        ../../gcc/gcc/cp/parser.c:8313
Please submit a full bug report, [etc.]

Reply via email to