https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94932
Bug ID: 94932
Summary: ICE in ovl_skip_hidden, at cp/tree.c:2292
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: asolokha at gmx dot com
Target Milestone: ---
gcc-10.1.0-RC20200430 ICEs when compiling the following testcase, extracted
from clang/testsuite/CXX/except/except.spec/p11-2a.cpp from the clang 10.0.0
test suite, w/ -std=c++2a:
namespace std {
struct strong_ordering {
};
}
namespace Synth {
struct A {
friend bool operator==(A, A) noexcept;
friend bool operator<(A, A) noexcept;
};
struct B {
A a;
friend std::strong_ordering operator<=>(B, B) = default;
};
std::strong_ordering operator<=>(B, B) noexcept;
}
% g++-10.1.0 -std=c++2a -c xwwacly6.cpp
xwwacly6.cpp: In function 'constexpr std::strong_ordering
Synth::operator<=>(Synth::B, Synth::B)':
xwwacly6.cpp:13:33: internal compiler error: in ovl_skip_hidden, at
cp/tree.c:2292
13 | friend std::strong_ordering operator<=>(B, B) = default;
| ^~~~~~~~
0x686390 ovl_skip_hidden(tree_node*)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/tree.c:2292
0x96f343 name_lookup::process_binding(tree_node*, tree_node*)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/name-lookup.c:497
0x97600b name_lookup::search_unqualified(tree_node*, cp_binding_level*)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/name-lookup.c:705
0x977f1c lookup_name_real_1
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/name-lookup.c:6555
0x9780f6 lookup_name_real(tree_node*, int, int, bool, int, int)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/name-lookup.c:6574
0x8746a6 add_operator_candidates
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/call.c:5955
0x87b68e build_new_op_1
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/call.c:6180
0x87c2ed build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/call.c:6570
0x963d2e build_comparison_op
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/method.c:1373
0x9652d9 synthesize_method(tree_node*)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/method.c:1550
0xa02bca maybe_instantiate_noexcept(tree_node*, int)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/pt.c:25189
0x8e9469 check_redeclaration_exception_specification
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/decl.c:1184
0x8fd259 duplicate_decls(tree_node*, tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/decl.c:2202
0x979360 do_pushdecl
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/name-lookup.c:3048
0x97c1c2 pushdecl(tree_node*, bool)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/name-lookup.c:3177
0x97c1c2 maybe_push_decl(tree_node*)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/name-lookup.c:3208
0x90e151 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/decl.c:5400
0x9be161 cp_parser_init_declarator
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/parser.c:20766
0x99e906 cp_parser_simple_declaration
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/parser.c:13734
0x9c8ff2 cp_parser_declaration
/var/tmp/portage/sys-devel/gcc-10.1.0_rc20200430/work/gcc-10.1.0-RC-20200430/gcc/cp/parser.c:13433