From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66A4439BA413; Tue, 3 Nov 2020 21:05:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66A4439BA413 From: "uecker at eecs dot berkeley.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97702] comma operator does not drop qualifiers during lvalue conversion Date: Tue, 03 Nov 2020 21:05:07 +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: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: uecker at eecs dot berkeley.edu 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 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: Tue, 03 Nov 2020 21:05:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97702 --- Comment #2 from Martin Uecker --- Thank you for the explanation. Interestingly, from the following list, the only example that removes the cast is the last one (which seems correct as ISO C specifies casts to produce a value with the unqualified type, for whatever reason). #define T1(x) ((void)0,x) #define T2(x) (+x) #define T3(x) (-x) #define T4(x) (1?x:x) #define T5(x) (*&(x)) #define T6(x) ((const int)x) int f(void) { const int j =3D 0; __typeof__(T6(j)) i =3D 0; i =3D 0; return i; }=