https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85064

            Bug ID: 85064
           Summary: [concepts] ICE with auto as template parameter
           Product: gcc
           Version: 8.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
            Blocks: 67491
  Target Milestone: ---

The following invalid code snippet (compiled with "-fconcepts")
triggers an ICE since GCC 6.1.0:

==========================================
template<int, typename T> void foo(T);

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

bug.cc: In substitution of 'template<int <anonymous>, class T> void foo(T)
[with int <anonymous> = 0; T = auto]':
bug.cc:5:17:   required from here
bug.cc:5:17: internal compiler error: in unify, at cp/pt.c:21109
   foo<0, auto>(0);
                 ^
0x63d13d unify
        ../../gcc/gcc/cp/pt.c:21109
0x986953 unify_one_argument
        ../../gcc/gcc/cp/pt.c:19700
0x98a3c3 type_unification_real
        ../../gcc/gcc/cp/pt.c:19820
0x98cab5 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:19205
0x82b68f add_template_candidate_real
        ../../gcc/gcc/cp/call.c:3179
0x82c0a0 add_template_candidate
        ../../gcc/gcc/cp/call.c:3258
0x82c0a0 add_candidates
        ../../gcc/gcc/cp/call.c:5514
0x82c4c1 add_candidates
        ../../gcc/gcc/cp/call.c:4186
0x82c4c1 perform_overload_resolution
        ../../gcc/gcc/cp/call.c:4194
0x82e542 build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc/gcc/cp/call.c:4267
0x9ac685 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
        ../../gcc/gcc/cp/semantics.c:2534
0x937fca cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:7245
0x9387e0 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:8324
0x9186df cp_parser_cast_expression
        ../../gcc/gcc/cp/parser.c:9092
0x918eea cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9193
0x91a724 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9488
0x91ae38 cp_parser_expression
        ../../gcc/gcc/cp/parser.c:9657
0x91cb18 cp_parser_expression_statement
        ../../gcc/gcc/cp/parser.c:11133
0x922f0d cp_parser_statement
        ../../gcc/gcc/cp/parser.c:10937
0x924470 cp_parser_statement_seq_opt
        ../../gcc/gcc/cp/parser.c:11276
Please submit a full bug report, [etc.]


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67491
[Bug 67491] [meta-bug] concepts issues

Reply via email to