CVS difference for ais/ai-00404.txt

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

--- ais/ai-00404.txt	2005/02/08 07:12:41	1.2
+++ ais/ai-00404.txt	2005/03/14 03:58:53	1.3
@@ -1,4 +1,4 @@
-!standard 3.10(6/2)                                    05-01-28  AI95-00404/01
+!standard 3.10(6/2)                                    05-02-13  AI95-00404/02
 !class amendment 05-01-28
 !status work item 05-01-28
 !status received 05-01-28
@@ -9,8 +9,10 @@
 
 !summary
 
-Not null is not permitted to be given explicitly for controlling access
-parameters.
+Not null is implicit, but may be given explicitly, for controlling
+access parameters and results. When defined by a renaming or
+a generic instantiation, the controlling access parameters and
+results must be null excluding.
 
 All is not permitted as a general access modifier for anonymous access
 types.
@@ -24,6 +26,11 @@
 superfluous. This provides the user with several different ways of
 saying the same thing which is confusing.
 
+However, specifying not null for controlling access parameters provides
+helpful documentation, and which parameters are controlling might
+change, or might not be obvious, so this sort of specification should
+be permitted, despite being redundant.
+
 !proposal
 
 (See summary.)
@@ -37,14 +44,17 @@
       [null exclusion] access [constant] subtype_mark |
     | [null exclusion] access [protected] procedure parameter_profile
     | [null exclusion] access [protected] function parameter_and_result_profile
-
-Insert after 3.10(12/2)
-
-An explicit null exclusion is not permitted in the case of an access
-definition that is for a controlling parameter.
 
-PS What about controlling results??
+Add after 3.9.2(11):
 
+  If a dispatching operation is defined by a subprogram_renaming_declaration or a
+  generic_instantiation, any controlling access parameter or controlling result of
+  the subprogram shall be null excluding.
+
+AARM Note on incompatibility:
+  This rule will require the addition of an explicit "not null" on
+  non-dispatching operations that are later renamed to be dispatching, or
+  on a generic that is used to define a dispatching operation.
 
 !discussion
 
@@ -73,8 +83,7 @@
    parameters are still always null excluding and so in that case P1, P3,
    P4, and P6 are all the same.
 
-This is ludicrous. It is very confusing to have unnecessary ways of saying
-the same thing.
+It is very confusing to have unnecessary ways of saying the same thing.
 
 We are stuck with access T as a parameter as being general because of
 backwards compatibility with Ada 95.
@@ -82,12 +91,12 @@
 It is therefore proposed that anonymous access types should just take the
 form
 
-AV: access T;
-AC: access constant T;
+   AV: access T;
+   AC: access constant T;
 
 and that
 
-AV: access all T;
+   AV: access all T;
 
 should not be permitted.
 
@@ -100,13 +109,39 @@
 
 Similarly, controlling access parameters have to be null excluding but
 for compatibility with Ada 95 we cannot require the programmer to insert
-not null everywhere. It is therefore proposed that explicit not null
-should not be permitted for controlling access parameters.
-[Editor's note: **Warning** This conflicts with AI-40?.]
-
-One could argue that permitting not null is tantamount to permitting
-multiple not nulls where the first is implied.
-
+not null everywhere. We considered disallowing an explicit not null
+where they are implicit, but it was anticipated that after a transition
+period, explicit not null would be used everywhere it applies, and disallowing
+its use for controlling access parameters or results would defeat this.
+
+For a dispatching operation defined by renaming or instantiation, we require
+that the renamed subprogram or generic subprogram be null excluding for each
+access parameter or access result that ends up controlling in the renaming or
+the instance.  For example:
+
+   generic
+      type GT is private;
+   procedure Gen_Subp_1(Y : access GT);
+
+   generic
+      type GT is private;
+   procedure Gen_Subp_2(Y : not null access GT);
+
+   with Gen_Subp_1; with Gen_Subp_2;
+   package P is
+      type T is tagged ....
+
+      package Inner is
+         procedure Not_Disp_1(X : access T);
+         procedure Not_Disp_2(X : not null access T);
+      end Inner;
+
+      procedure Ren1(X : access T) renames Not_Disp_1; -- illegal
+      procedure Ren2(X : access T) renames Not_Disp_2; -- legal
+
+      procedure Inst1 is new Gen_Subp_1(T); -- illegal
+      procedure Inst2 is new Gen_Subp_2(T); -- legal
+   end P;
 
 !example
 

Questions? Ask the ACAA Technical Agent