https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85067
Bug ID: 85067
Summary: [8 Regression] ICE with volatile parameter in
defaulted copy-constructor
Product: gcc
Version: 8.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
Target Milestone: ---
The following invalid code snippet triggers an ICE on trunk:
==================================
template<int> struct A
{
A();
A(volatile A&) = default;
};
struct B
{
A<0> a;
};
B b;
==================================
bug.cc: In instantiation of 'struct A<0>':
bug.cc:9:8: required from here
bug.cc:4:3: error: defaulted declaration 'A<<anonymous> >::A(volatile
A<<anonymous> >&) [with int <anonymous> = 0]' does not match the expected
signature
A(volatile A&) = default;
^
bug.cc:4:3: note: expected signature: 'constexpr A<0>::A(A<0>&)'
bug.cc:12:3: internal compiler error: in implicitly_declare_fn, at
cp/method.c:2059
B b;
^
0x61e3ab implicitly_declare_fn(special_function_kind, tree_node*, bool,
tree_node*, tree_node*)
../../gcc/gcc/cp/method.c:2059
0x8f5e63 lazily_declare_fn(special_function_kind, tree_node*)
../../gcc/gcc/cp/method.c:2392
0x8fd544 get_class_binding(tree_node*, tree_node*, int)
../../gcc/gcc/cp/name-lookup.c:1297
0x9a2625 lookup_field_r
../../gcc/gcc/cp/search.c:977
0x9a178d dfs_walk_all(tree_node*, tree_node* (*)(tree_node*, void*), tree_node*
(*)(tree_node*, void*), void*)
../../gcc/gcc/cp/search.c:1410
0x9a1972 lookup_member(tree_node*, tree_node*, int, bool, int,
access_failure_info*)
../../gcc/gcc/cp/search.c:1134
0x9a1c53 lookup_fnfields(tree_node*, tree_node*, int)
../../gcc/gcc/cp/search.c:1329
0x823c91 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
../../gcc/gcc/cp/call.c:8932
0x8d2923 expand_default_init
../../gcc/gcc/cp/init.c:1892
0x8d2923 expand_aggr_init_1
../../gcc/gcc/cp/init.c:2007
0x8d3289 build_aggr_init(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/init.c:1747
0x887ddf build_aggr_init_full_exprs
../../gcc/gcc/cp/decl.c:6273
0x887ddf check_initializer
../../gcc/gcc/cp/decl.c:6422
0x89fbdc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:7127
0x93c2eb cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:19741
0x943758 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:13059
0x944568 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:12884
0x9484c2 cp_parser_declaration
../../gcc/gcc/cp/parser.c:12782
0x9488d1 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:12658
0x948bc4 cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4563
Please submit a full bug report, [etc.]
The regression was introduced between 2017-09-26 and 2017-10-07.