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

            Bug ID: 61924
           Summary: [C++11] ICE in instantiate_template_1, at
                    cp/pt.c:15618
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Google ref: b/16582830

Gcc 4.8, 4.9 and current trunk @r213084 are affected.

// --- cut ---
struct function
{
    template < typename _Functor > function (_Functor);
};

template < typename > struct RetryingRpc
{
  template < typename StubType> RetryingRpc (StubType, function =[]{});
};

void fn()
{
  RetryingRpc<int> rpc(0, []{});
};
// --- cut ---

This is accepted by Clang, ICEs with current trunk:

gcc-svn-r213084/bin/g++ -c -std=c++11 t.ii
t.ii: In substitution of ‘template<class StubType> RetryingRpc<
<template-parameter-1-1> >::RetryingRpc(StubType, function) [with StubType =
int]’:
t.ii:13:31:   required from here
t.ii:13:31: internal compiler error: in instantiate_template_1, at
cp/pt.c:15618
   RetryingRpc<int> rpc(0, []{});
                               ^
0x5c094b instantiate_template_1
    ../../gcc/cp/pt.c:15618
0x5c094b instantiate_template(tree_node*, tree_node*, int)
    ../../gcc/cp/pt.c:15730
0x5ef8cb fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
    ../../gcc/cp/pt.c:16079
0x55f659 add_template_candidate_real
    ../../gcc/cp/call.c:3025
0x5600dc add_template_candidate
    ../../gcc/cp/call.c:3122
0x5600dc add_candidates
    ../../gcc/cp/call.c:5253
0x560956 build_new_method_call_1
    ../../gcc/cp/call.c:7944
0x560956 build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
    ../../gcc/cp/call.c:8140
0x561f29 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
    ../../gcc/cp/call.c:7684
0x6b7299 expand_default_init
    ../../gcc/cp/init.c:1707
0x6b7299 expand_aggr_init_1
    ../../gcc/cp/init.c:1808
0x6b9f5c build_aggr_init(tree_node*, tree_node*, int, int)
    ../../gcc/cp/init.c:1560
0x574b5c build_aggr_init_full_exprs
    ../../gcc/cp/decl.c:5645
0x574b5c check_initializer
    ../../gcc/cp/decl.c:5789
0x58544c cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
    ../../gcc/cp/decl.c:6461
0x676995 cp_parser_init_declarator
    ../../gcc/cp/parser.c:17058
0x6780d5 cp_parser_simple_declaration
    ../../gcc/cp/parser.c:11421
0x65bcf3 cp_parser_block_declaration
    ../../gcc/cp/parser.c:11302
0x65ce31 cp_parser_declaration_statement
    ../../gcc/cp/parser.c:10949
0x65d51b cp_parser_statement
    ../../gcc/cp/parser.c:9664
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.

Reply via email to