From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C8D9539484B4; Wed, 20 Jan 2021 09:37:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8D9539484B4 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/772] Statement expressions issues Date: Wed, 20 Jan 2021 09:37:20 +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: 2.97 X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub 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: 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: Wed, 20 Jan 2021 09:37:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D772 --- Comment #17 from Jakub Jelinek --- (In reply to Ed Smith-Rowland from comment #14) > I wonder what the relationship of these expression statements are to lamb= das. >=20 > Is ({int _a =3D (a), _b =3D (b); _a > _b ? _a : _b; }) > equivalent to > [](){int _a =3D (a), _b =3D (b); _a > _b ? _a : return _b; }} >=20 > Can expression statements change enclosing scope variables? It seems like > they could. The lambda may need to be mutable. >=20 > Maybe these could route to the lambda code. >=20 > Just an idle thought. There are substantial differences. E.g. one can do ({ return 1; }), with lambdas it means something different, or ({ break; }) or ({ continue; }).=