From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2561A398EC02; Fri, 12 Mar 2021 15:36:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2561A398EC02 From: "iains at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/96749] [coroutines] unexpected 'warning: statement has no effect [-Wunused-value]' Date: Fri, 12 Mar 2021 15:36:08 +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: iains at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: iains at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status assigned_to attachments.created 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: Fri, 12 Mar 2021 15:36:09 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96749 Iain Sandoe changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |iains at gcc dot gn= u.org --- Comment #4 from Iain Sandoe --- Created attachment 50377 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50377&action=3Dedit Patch under test thanks for the reports. Even though user code cannot, the compiler can generate things like: (make some temporary, use that temporary) So a compound statement that builds a temporary that we then use in the sec= ond part. When this idiom was encountered, the transforms applied to split await expressions out were producing something like { build temporary temporary use the temporary } so the middle statement was harmless, but also has no effect (hence the warning). the patch under test accounts for this idiom.=