From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C4D033858C74; Tue, 4 Oct 2022 20:41:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4D033858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664916086; bh=x43dBTdh1RMU1erpKKS1RdJBO/QKGgdaKG1CwubHPoU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bapa+ivXAylaavVVcJ/v9heFMdj1Yy6uMQBMI2a6B1QCm5j5bR2DTwwYRXcJhFnx5 bWq8z5+Tay5NiTLRNAyRudjc7nABVwNRYtFGOX4T9Ioy4kmquAAgq/h9Ti8RP6UfrE 5Iz8MNKzRtsr5B7nTrQETJS7UaZU3iw9/g0yljMA= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107085] __reference_constructs_from_temporary does not detect static up-cast Date: Tue, 04 Oct 2022 20:41:26 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107085 --- Comment #7 from Marek Polacek --- ...which could be fixed with --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -9186,7 +9186,9 @@ conv_is_prvalue (conversion *c) { if (c->kind =3D=3D ck_rvalue) return true; - if (c->kind =3D=3D ck_base && c->need_temporary_p) + if (c->kind =3D=3D ck_base + /* TODO */ + && (c->need_temporary_p || conv_is_prvalue (next_conversion (c)))) return true; if (c->kind =3D=3D ck_user && !TYPE_REF_P (c->type)) return true; but that then causes ICEs in build_over_call, at cp/call.cc:9987=