CVS difference for ais/ai-00414.txt

Differences between 1.3 and version 1.4
Log of other versions for file ais/ai-00414.txt

--- ais/ai-00414.txt	2005/02/10 05:46:42	1.3
+++ ais/ai-00414.txt	2005/04/13 05:37:23	1.4
@@ -1,7 +1,7 @@
-!standard 6.05.01      (01)                            05-02-02  AI95-00414/01
-!standard 11.04.01     (04)
-!standard 11.04.01     (14)
+!standard 6.05.01      (01)                            05-03-09  AI95-00414/02
 !class amendment 05-02-02
+!status Amendment 200Y 05-03-09
+!status ARG Approved 8-0-2  05-02-12
 !status work item 05-02-02
 !status received 05-02-02
 !priority Medium
@@ -75,13 +75,17 @@
     The form of a pragma No_Return, which is a representation pragma (see 13.1),
     is as follows:
 
-      pragma No_Return(local_name {, local_name});
+      pragma No_Return(procedure_local_name {, procedure_local_name});
 
                      Legality Rules
 
-  Each local_name shall denote one or more procedures or
+  Each procedure_local_name shall denote one or more procedures or
   generic procedures; the denoted entities are "non-returning".
-  The local_name shall not denote an instance of a generic unit.
+  The procedure_local_name shall not denote a null procedure nor an instance
+  of a generic unit.
+
+AARM Reason: A null procedure cannot have the appropriate non-returning
+semantics, as it does not raise an exception or loop forever.
 
 AARM Ramification: The procedure can be abstract. The denoted declaration can
 be a renaming_declaration if it obeys the usual rules for representation
@@ -115,11 +119,6 @@
   If the body of a non-returning procedure completes normally,
   Program_Error is raised at the point of the call.
 
-                     Erroneous Execution
-
-  If an imported non-returning procedure returns normally,
-  execution is erroneous.
-
 Note: AI-00329 also modifies 11.4.1; this AI retains those modifications as is.
 
 AARM Discussion:
@@ -210,12 +209,8 @@
 There is one exception to the principle that "we must ensure that the
 property asserted by the pragma is actually true". For a pragma-Import
 procedure, it is the responsibility of the foreign-language code to obey
-the stated contract. Therefore, we make violations in that case
-erroneous. Also, if we required Program_Error to be raised in this
-case, the compiler would have to generate a wrapper procedure or (in
-some cases) do the raise at the call site. We do not wish to require
-*two* run-time models (sometimes in body, sometimes at call site), and
-we do not wish to require wrappers.
+the stated contract. This is the normal rule for interfacing pragmas, so
+we don't need to state this explicitly.
 
 Note: procedure "exit", imported from C, is a reasonable example of an
 imported procedure that deserves a pragma No_Return.
@@ -306,18 +301,18 @@
 The pragma is not a program unit pragma. It is now a representation pragma.
 This better matches the intended semantics.
 
-The "local_name shall denote" wording better specifies which entities
+The "procedure_local_name shall denote" wording better specifies which entities
 can have the pragma. AI-00329 forbade abstract procedures, but there's
 no reason to forbid them. AI-00329 apparently intended to allow
 renamings (in the usual "local_name" way), but it wasn't clear; now it's
 clear that they're allowed.
 
-"The local_name shall not denote an instance of a generic unit." is
+"The procedure_local_name shall not denote an instance of a generic unit." is
 added, because the legality rule "A return_statement shall not apply to
 a non-returning procedure or generic procedure." cannot be reasonably
 checked on instances.
 
-AI-00329 did not consider renamings-as-body nor pragma Import.
+AI-00329 did not consider renamings-as-body.
 
 The rule "If a procedure declared within a generic unit is
 non-returning, then so are the corresponding copies of that procedure in
@@ -328,6 +323,56 @@
 procedure" part, because inside the procedure body, it's a procedure
 (the current instance). Nonetheless, the rule seems clearer with the
 meaningless "or generic procedure" part.
+
+!corrigendum 6.5.1(1)
+
+@dinsc
+A @fa<pragma> No_Return indicates that a procedure cannot return normally;
+it may propagate an exception or loop forever.
+
+@i<@s8<Syntax>>
+
+The form of a @fa<pragma> No_Return, which is a representation pragma (see
+13.1), is as follows:
+
+@xindent<@b<pragma> No_Return(@i<procedure_>@fa<local_name>{, @i<procedure_>@fa<local_name>});>
+
+@i<@s8<Legality Rules>>
+
+Each @i<procedure_>@fa<local_name> shall denote one or more procedures or
+generic procedures; the denoted entities are @i<non-returning>.
+The @i<procedure_>@fa<local_name> shall not denote a null procedure nor
+an instance of a generic unit.
+
+A @fa<return_statement> shall not apply to a non-returning procedure or generic
+procedure.
+
+A procedure shall be non-returning if it overrides a dispatching
+non-returning procedure. In addition to the places where Legality
+Rules normally apply (see 12.3), this rule applies also in the private
+part of an instance of a generic unit.
+
+If a renaming-as-body completes a non-returning procedure declaration,
+then the renamed procedure shall be non-returning.
+
+@i<@s8<Static Semantics>>
+
+If a generic procedure is non-returning, then so are its instances.
+If a procedure declared within a generic unit is non-returning,
+then so are the corresponding copies of that procedure in instances.
+
+@i<@s8<Dynamic Semantics>>
+
+If the body of a non-returning procedure completes normally,
+Program_Error is raised at the point of the call.
+
+
+!ACATS test
+
+In addition to the tests described in AI-329, create a B-Test to check that
+null procedures cannot have No_Return applied. Create a B-Test to check that
+No_Return is inherited. Create a B-Test to check that the rules of a
+representation pragma are properly checked for No_Return.
 
 !appendix
 

Questions? Ask the ACAA Technical Agent