From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,45c6e2680274292d,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.196.232 with SMTP id ip8mr1886884pbc.6.1342196480729; Fri, 13 Jul 2012 09:21:20 -0700 (PDT) Path: l9ni11632pbj.0!nntp.google.com!news1.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Marc C Newsgroups: comp.lang.ada Subject: Labeled exit within generalized labeled loop not allowed? Date: Fri, 13 Jul 2012 09:19:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: NNTP-Posting-Host: 134.223.116.200 Mime-Version: 1.0 X-Trace: posting.google.com 1342196480 31369 127.0.0.1 (13 Jul 2012 16:21:20 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 13 Jul 2012 16:21:20 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=134.223.116.200; posting-account=mjE6MAoAAADjsB3NIuKgfHO4u-Elh3cb User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-07-13T09:19:37-07:00 List-Id: I find it hard to believe that this would be a GNAT GPL 2012 compiler bug, but I don't see anything in the LRM that indicates this wouldn't be legal. Code containing a labeled generalized loop (the "for Elem of Some_Container" type), with a conditional exit referencing the loop label, fails to compile with an "Invalid loop name in exit statement" error. What's the rationale for this? Or a consequence of what? Or is it a compiler bug? Marc A. Criley Here's an example: with Text_IO; use Text_IO; procedure Loop_Check is type Int_Array_Type is array (1..10) of Integer; IA : Int_Array_Type := (6 => 6, others => 3); begin Loop_A: For I in IA'range loop Put_Line(Integer'Image(IA(I))); exit Loop_A When IA(I) = 6; end loop Loop_A; Loop_B: For I of IA loop Put_Line(Integer'Image(I)); exit when I = 6; end loop Loop_B; Loop_C: For I of IA loop Put_Line(Integer'Image(I)); exit Loop_C when I = 6; -- Compiler error on this line end loop Loop_C; end Loop_Check;