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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: 'for cursor in container.first loop' bug? Date: Thu, 28 Aug 2014 21:46:32 +0100 Organization: A noiseless patient Spider Message-ID: References: <85y4u8xztj.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="523de1ab7c05e00b011ba57e8953fa66"; logging-data="23744"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+10u7sp9vGtJ/GC+lz93buogHvgXtvvs8=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:ICPgb/GFcGH1svPkPHpSGYZF+PU= sha1:KGkWoQFJMc+DL0a9p6EaqrUd/oY= Xref: news.eternal-september.org comp.lang.ada:21968 Date: 2014-08-28T21:46:32+01:00 List-Id: While scratching my head over 5.5.2 Generalized Loop Iteration, I looked at A.18.32 Example of Container Use[1] and tried compiling with GNAT GPL 2014 and GCC 4.9.0. The full example compiled fine, but when I attempted the substitution in (29) this happened: 55. -- Update minimum distance to newly reachable nodes. 56. for E of G (Next) loop 57. if not Reached(E.To) then 58. Nearest_Distance := E.Length + So_Far(Next); 59. if Nearest_Distance < So_Far(E.To) then 60. Reached_From(E.To) := Next; 61. So_Far(E.To) := Nearest_Distance; 62. end if; 63. end if; 64. end loop; (so the original was OK, but ...) 65. for C in G (Next).Iterate loop 66. declare 67. E : Edge renames G (Next)(C).all; | >>> access type required in prefix of explicit dereference 68. begin 69. if not Reached(E.To) then | >>> invalid prefix in selected component "E" 70. Nearest_Distance := E.Length + So_Far(Next); | >>> invalid prefix in selected component "E" 71. if Nearest_Distance < So_Far(E.To) then | >>> invalid prefix in selected component "E" 72. Reached_From(E.To) := Next; | >>> invalid prefix in selected component "E" 73. So_Far(E.To) := Nearest_Distance; | >>> invalid prefix in selected component "E" 74. end if; 75. end if; 76. end; 77. end loop; [1] http://www.ada-auth.org/standards/12rm/html/RM-A-18-32.html