From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 268503858283; Wed, 28 Sep 2022 13:42:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 268503858283 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664372520; bh=+7xs+dreKtYmit2Katfr2FUIN7/uwtPE9I8pynAePQQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QvUcYHyaB9np5jGDSlFNmj35Nk5FK2vlqiun9r7JRm6DkO1ltasd3fTYDi6NOpS4t xcaYGbpEqVv0JtnkYi5ytHiH5lcFz8KWj1FLI9hPf1KwWxRx+AC+HdY0BD7PNlZDzQ i4MPdx1WMh+FyFG+JhBYyjPZ7f4onZ9XFrNeHcW0= From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107065] GCC treats rvalue as an lvalue Date: Wed, 28 Sep 2022 13:41:59 +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: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW 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: cc 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=3D107065 Marek Polacek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #5 from Marek Polacek --- Even GCC 4.8 rejects #c4, so doesn't look like a regression. We deduce bool& in the first decltype: finish_decltype_type gets a VAR_DECL= 'b' (that's wrong I think), id_expression_or_member_access_p is false (that is correct). lvalue_kind then of course reports that the VAR_DECL is an ordin= ary lvalue, and we deduce to bool&, just like it were decltype((b)). So the problem must be that we strip both NEGATE_EXPRs.=