From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 949603858C3A; Thu, 9 Dec 2021 21:44:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 949603858C3A From: "js-gcc at webkeks dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug objc/103639] [REGRESSION] GCC 11.2 (or even earlier) breaks switch case with break in fast enumeration loop Date: Thu, 09 Dec 2021 21:44:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: objc X-Bugzilla-Version: 11.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: js-gcc at webkeks dot org X-Bugzilla-Status: WAITING 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: keywords 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: Thu, 09 Dec 2021 21:44:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103639 js-gcc at webkeks dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|wrong-code | --- Comment #4 from js-gcc at webkeks dot org --- Sure: #import int main() { OFArray *array =3D [OFArray arrayWithObjects: @"a", @"b", nil]; int someVar =3D 0; for (id object in array) { switch (someVar) { case 0: OFLog(@"%@", object); break; } OFLog(@"foo"); } return 0; } Sorry, but something free-standing isn't possible as you need a collection object. The same code should work with GNUstep by just replacing OF with NS= .=