From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0953A3858C56; Tue, 4 Oct 2022 19:34:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0953A3858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664912067; bh=G4qx3wtFwIugzUI9ZTNvUCui9GC0S+G2NzYVgnShETQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=d3stjSibS3Mzh9KUw1ean4324gUj6jcGGPu9PXGwb++F9/pIHMK3uk2ccG5gOfI0/ kVufW3wCYChk/2427YXx4DdQG78EB4T3qeI4Pz0luC4tF7ZBidZhyHS2mi3LnSTH/6 yNnEPVNZP46uAk7iIcQWQqBSIeVYCyNPqaGJGrPQ= 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 19:34: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 #6 from Marek Polacek --- (In reply to Roy Jacobson from comment #3) > Thanks! But a Base const& is still not detected: >=20 > static_assert(__reference_constructs_from_temporary(Base const&, Derived)= ); >=20 > And in this case I think it _is_ a bug that this doesn't compile? To make sure I understand this correctly, __reference_constructs_from_tempo= rary should say "yes" here, because it's just like const Base& b(Derived{}); where we bind 'b' to the Base subobject of a temporary Derived object, yes?=