!standard 8.3(2) 15-01-19 AI12-0094-1/03 !standard 8.3(26/3) !class binding interpretation 13-11-12 !status Corrigendum 1-2012 14-11-12 !status WG9 Approved 15-06-26 !status ARG Approved 7-0-1 14-10-18 !status work item 13-11-12 !status received 13-11-05 !priority Medium !difficulty Easy !qualifier Omission !subject An access_definition should be a declarative region !summary An access_definition is a declarative region. !question Is the following legal? type T is access function (A : Integer) return access function (A : Float) return Boolean; One might expect that it is legal, but according to RM "8.1 Declarative Region" there is a declarative region for T and two declarations of A immediately within it, which is illegal by 8.3(26/2). Should we change the definition of "declarative region" to include an access_definition? (Yes.) !recommendation (See Summary.) !wording Add after 8.1(2): * an access_definition; !discussion This clearly seems like an oversight. GNAT allows this example (it thinks it is legal). !corrigendum 8.1(2) @dinsa @xbullet @dinst @xbullet;> !ASIS Not my job. [Editor's note: :-). I don't know ASIS well enough to know if this has a visible effect or not, so I would have left it as **TBD and asked J-P.] !ACATS test Create an ACATS C-Test like the original question and like the example in the AARM note 8.1(18.r-t/4), but a rather low priority to do so. !appendix From: Bob Duff Sent: Tuesday, November 5, 2013 7:13 AM Maxim Reznik (reznik@adacore.com) noticed this issue. Is the following legal? type T is access function (A : Integer) return access function (A : Float) return Boolean; I'd think it should be legal, but according to RM "8.1 Declarative Region" there is a declarative region for T and two declarations of A immediately within it, which is illegal by 8.3(26/2). Should we change the definition of "declarative region" to include an access_to_subprogram_definition? GNAT says it's legal. **************************************************************** From: Tucker Taft Sent: Tuesday, November 5, 2013 8:54 AM > ... Should we change the definition of "declarative region" to include > an access_to_subprogram_definition? Yes, I would agree with that change. **************************************************************** From: Steve Baird Sent: Tuesday, November 5, 2013 11:27 AM Sounds right to me too. Without this change there would also be questions about factored lists, as in procedure P (X, Y : access procedure (Z : in out Integer)); Is there one Z here or two? Pick your poison; without the proposed change either answer has unpleasant consequences (either the normal equivalence breaks down or we reject a case where the identifier Z only occurs once (textually) in the source). **************************************************************** From: Erhard Ploedereder Sent: Tuesday, November 5, 2013 4:04 PM > Should we change the definition of "declarative region" to include an > access_to_subprogram_definition? Yes, of course. Clearly an oversight in the LRM. ****************************************************************