From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E56C3858417; Tue, 19 Mar 2024 11:31:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E56C3858417 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710847906; bh=wacZ4invfo3puZD+mBXKcMmMCDN6hAmSrsXJKkwqES4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RshPrgL/YMx3EcnGzL2BUvOIbrX10ZV8NicF3FqGBUx1jGIblZKBHHiMZZGsfX2Zn lj46GmzDyIcED5VJWzmxojVLskS490SPAkChxkzkoj5qql0qXR42e8qwNST/vvrAGK 97ZxPyf2T1Ks5GpWf8b5BHnNioiCkJjr4yQnclBU= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114388] Behavioral change of typeid on xvalues since GCC 9 Date: Tue, 19 Mar 2024 11:31:46 +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: 9.5.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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: 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=3D114388 --- Comment #6 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #5) > In C++98 the const B& is an lvalue, and in C++11 the B&& is an xvalue whi= ch > is a glvalue. Either way, it's correct to treat it as a glvalue of > polymorphic type and evaluate it. Or more precisely, in C++98 it's an lvalue and the rule is that lvalues are evaluated. In C++11 it's an xvalue which is a glvalue, and the rule is that glvalues a= re evaluated. So even though N3055 isn't a DR, that doesn't matter. The behaviour changed with DR 616 not with N3055.=