From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4B45A385800A; Wed, 13 Oct 2021 07:58:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4B45A385800A From: "asolokha at gmx dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102724] New: [11/12 Regression] ICE in genericize_spaceship, at cp/method.c:1089 Date: Wed, 13 Oct 2021 07:58:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: error-recovery, ice-on-invalid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: asolokha at gmx dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2021 07:58:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102724 Bug ID: 102724 Summary: [11/12 Regression] ICE in genericize_spaceship, at cp/method.c:1089 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: error-recovery, 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: --- g++-12.0.0-alpha20211010 snapshot (g:74ccca380cde5e79e082d39214b306a90ded03= 44) ICEs when compiling the following testcase, reduced from test/CXX/class/class.compare/class.spaceship/p1.cpp from the clang 12.0.0 t= est suite, w/ -std=3Dc++20: namespace std { struct strong_ordering { int n; constexpr operator int() const { return n; } static const strong_ordering less, equal, greater; }; constexpr strong_ordering strong_ordering::less{-1}, strong_ordering::equal{0}, strong_ordering::greater{1}; } namespace Synthesis { enum Result { False, True, Mu }; constexpr bool toBool(Result R) { return R =3D=3D True; } struct Val { Result equal, less; constexpr bool operator=3D=3D(const Val&) const { return toBool(equal);= } constexpr bool operator<(const Val&) const { return toBool(less); } }; template struct Cmp { Val val; friend T operator<=3D>(const Cmp&, const Cmp&) =3D default; }; struct custom_ordering { custom_ordering(std::strong_ordering o); }; void f(Cmp c) { c <=3D> c; } } % g++-12.0.0 -std=3Dc++20 -c mfri5bsa.cpp mfri5bsa.cpp: In function 'void Synthesis::f(Synthesis::Cmp)': mfri5bsa.cpp:31:11: error: use of deleted function 'constexpr Synthesis::custom_ordering Synthesis::operator<=3D>(const Synthesis::Cmp&, const Synthesis::Cmp&)' 31 | c <=3D> c; | ^ mfri5bsa.cpp:24:14: note: 'constexpr Synthesis::custom_ordering Synthesis::operator<=3D>(const Synthesis::Cmp&,= const Synthesis::Cmp&)' is implicitly deleted because= the default definition would be ill-formed: 24 | friend T operator<=3D>(const Cmp&, const Cmp&) =3D default; | ^~~~~~~~ mfri5bsa.cpp:23:9: error: no match for 'operator<=3D>' (operand types are 'Synthesis::Val' and 'Synthesis::Val') 23 | Val val; | ^~~ mfri5bsa.cpp:24:14: internal compiler error: in genericize_spaceship, at cp/method.c:1089 24 | friend T operator<=3D>(const Cmp&, const Cmp&) =3D default; | ^~~~~~~~ 0x6ba1ae genericize_spaceship(unsigned int, tree_node*, tree_node*, tree_no= de*) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/method.c:1089 0xa3d849 do_one_comp =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/method.c:1388 0xa3e2de build_comparison_op(tree_node*, bool, int) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/method.c:1595 0xa45d4e maybe_explain_implicit_delete(tree_node*) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/method.c:2822 0x9f7d7c mark_used(tree_node*, int) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/decl2.c:5703 0x93e0a6 build_over_call =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/call.c:9721 0x9449f2 build_new_op_1 =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/call.c:6711 0x9450cd build_new_op(op_location_t const&, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node**, int) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/call.c:6970 0xb939cd build_x_binary_op(op_location_t const&, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int) =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/typeck.c:4483 0xaa3ec7 cp_parser_binary_expression =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:10073 0xaa469d cp_parser_assignment_expression =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:10211 0xaa6162 cp_parser_expression =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:10381 0xaa99f8 cp_parser_expression_statement =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:12574 0xab6ff9 cp_parser_statement =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:12370 0xab80bd cp_parser_statement_seq_opt =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:12722 0xab8198 cp_parser_compound_statement =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:12671 0xad9138 cp_parser_function_body =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:24904 0xad9138 cp_parser_ctor_initializer_opt_and_function_body =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:24955 0xad9eba cp_parser_function_definition_after_declarator =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:31085 0xadb22b cp_parser_function_definition_from_specifiers_and_declarator =20=20=20=20=20=20=20 /var/tmp/portage/sys-devel/gcc-12.0.0_alpha20211010/work/gcc-12-20211010/gc= c/cp/parser.c:31001=