CVS difference for ais/ai-00135.txt

Differences between 1.1 and version 1.2
Log of other versions for file ais/ai-00135.txt

--- ais/ai-00135.txt	1998/09/30 00:17:24	1.1
+++ ais/ai-00135.txt	1999/08/16 19:52:42	1.2
@@ -1,5 +1,6 @@
-!standard 08.05.04 (05)                               97-04-11  AI95-00135/02
+!standard 08.05.04 (05)                               99-08-08  AI95-00135/03
 !class binding interpretation 96-05-07
+!status Corrigendum 2000 99-08-13
 !status WG9 approved (8-0-0) 97-07-04
 !status ARG approved (6-0-3) 97-04-11
 !status work item 96-05-08
@@ -9,13 +10,13 @@
 !difficulty Medium
 !subject Circular Renamings as Body
 
-!summary 96-05-08
+!summary
 
 A circular renaming-as-body represents infinite recursion.  If the
 renaming-as-body occurs before the subprogram whose body is being
 defined is frozen, the renaming-as-body is illegal.
 
-!question 96-05-08
+!question
 
 Consider the following example:
 
@@ -40,16 +41,18 @@
 frozen.  Therefore, F takes its calling convention from H, which comes
 from G, which comes from F.  So what is the calling convention of F?
 
-!recommendation 96-05-08
+!recommendation
 
 For a subprogram whose body is defined by a renaming-as-body, if the
 rule in 8.5.4(5) requires the calling convention of the subprogram to be
 taken ultimately from itself, then the renaming-as-body is illegal.
 
-!wording 96-05-08
+!wording
 
-!discussion 96-07-23
+(See corrigendum.)
 
+!discussion
+
 In the above example, the definition of the calling convention of F is
 not well-defined, because of the circular definition in 8.5.4(5).
 Therefore, we choose to make this case illegal.
@@ -109,8 +112,48 @@
 conformance required by 8.5.4(5) is satisfied.
 
 Any call to F or P.all will result in infinite recursion.
+
+!corrigendum 8.05.04(5)
+
+@drepl
+The profile of a renaming-as-body shall be subtype-conformant with that
+of the renamed callable entity, and shall conform fully to that of the
+declaration it completes. If the renaming-as-body completes that declaration
+before the subprogram it declares is frozen, the subprogram it declares takes
+its convention from the renamed subprogram; otherwise the convention of the
+renamed subprogram shall not be Intrinsic.
+@dby
+The profile of a renaming-as-body shall be subtype-conformant with that
+of the renamed callable entity, and shall conform fully to that of the
+declaration it completes. If the renaming-as-body completes that declaration
+before the subprogram it declares is frozen, the subprogram it declares takes
+its convention from the renamed subprogram; otherwise the convention of the
+renamed subprogram shall not be Intrinsic. A renaming-as-body is illegal if the
+declaration occurs before the subprogram is frozen, and the renaming renames
+the subprogram itself, either directly or indirectly.
+
+!corrigendum 8.05.04(8)
+
+@dinsa
+For a call on a renaming of a dispatching subprogram that is overridden,
+if the overriding occurred before the renaming, then the body executed is
+that of the overriding declaration, even if the overriding declaration is not
+visible at the place of the renaming; otherwise, the inherited or predefined
+subprogram is called.
+@dinst
+@i<@s8<Bounded (Run-Time) Errors>>
+
+If a subprogram directly or indirectly renames itself, then it is a bounded
+error to call that subprogram. Possible consequences are that Program_Error
+or Storage_Error is raised, or that the call results in an indefinite loop.
+
+!ACATS test
+
+A B-Test should be created to check the illegal case. The B-Test should
+include the legal cases as well. (Note that a C-Test can't be usefully
+constructed, as any call would never terminate.)
 
-!appendix 96-05-07
+!appendix
 
 !section 8.5.4(05)
 !subject Renaming as Body
@@ -125,7 +168,7 @@
 
 -------------attachment starts here-------------
 
-Tucker,    
+Tucker,
 
 Would you mind answering another Ada95 language question?
 This one's for renaming-as-body declarations that rename themselves
@@ -171,5 +214,19 @@
 -Tucker Taft   stt@inmet.com
 
 -------------attachment ends here-------------
+
+****************************************************************
+
+!from Robert Eachus 99-08-08
+
+I added wording to avoid putting an onerous burden on implementors.  The intent
+is to make certain troublesome cases illegal, but the first sentence of the
+summary: "A circular renaming-as-body represents infinite recursion." is overly
+specific. This case should actually be a bounded error, allowing for at a
+minimum infinite recursion, Program_Error, or Storage_Error. I could even
+make an argument for allowing these cases to be detected and rejected at link
+time, but it seems to me that raising Program_Error for such circular renamings
+is easy enough: just flag them as never elaborated. If people think this is
+exceeding my charter, we can just omit the bounded error paragraph.
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent