CVS difference for ai12s/ai12-0338-1.txt

Differences between 1.1 and version 1.2
Log of other versions for file ai12s/ai12-0338-1.txt

--- ai12s/ai12-0338-1.txt	2019/07/03 03:33:44	1.1
+++ ai12s/ai12-0338-1.txt	2019/07/03 03:46:34	1.2
@@ -1,4 +1,4 @@
-!standard 7.3.2(18.1/5)                                    19-06-15  AI12-0338-1/01
+!standard 7.3.2(21/4)                                    19-06-16  AI12-0338-1/02
 !class binding interpretation 19-06-15
 !status work item 19-06-15
 !status received 19-06-14
@@ -72,24 +72,16 @@
 
 !wording
 
-Replace 7.3.2(18.1/5):
+Add before 7.3.2(21/4):
 
-    an access-to-object parameter or result whose designated nominal type
-    has a part of type T;
-
-with:
-
-    an access-to-object parameter or result whose designated nominal type
-    has a part of type T and either the designated nominal type is not an
-    incomplete view (at the point of the declaration of the callable
-    entity) or the completion of the designated nominal type occurs in
-    the same declaration list as the incomplete declaration.
+If the nominal type of a formal parameter (or the designated nominal type of 
+an access-to-object parameter) is incomplete at the point of the declaration 
+of the callable entity, and if the completion of that incomplete type does 
+not occur in the same declaration list as the incomplete declaration, then 
+for purposes of the preceding rules the nominal type is considered to have 
+no parts of type T.
 
-    AARM note: This ensures that the completion of the designated nominal
-    type is available when determining the parts that need to be checked.
-
-Modify AARM 7.3.2(23.a/5):
-
+modify 7.3.2(23.a/5)
      ...  is not itself externally visible. { Incomplete types or
      class-wide types may be used to produce cases where subcomponents
      are not checked. } These cases represent holes ...
@@ -136,5 +128,91 @@
 
 Opening a new AI, spun off from AI12-0191. [This is version /01 of the 
 AI - Editor.]
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Saturday, June 15, 2019  5:04 PM
+
+Couple of comments:
+
+(1) You need some wording to add to the "leak" AARM note, since this clearly 
+causes another leak. That is, a short explanation of the leak and how to avoid 
+it (see AI12-0210-1 for the form).
+
+(2) I think you need to explain somewhere (probably !discussion) why there 
+isn't a similar problem for parameters of an incomplete type (rather than 
+just access types of incomplete types). I know you guys claimed it isn't a 
+problem, and perhaps that's true, but we need to make it clear that we 
+considered that (obviously similar) case and ruled out problems. (It's 
+uncomfortable to have different rules for designated types and directly used 
+types, but one can argue making a hole as small as possible is best.)
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Saturday, June 15, 2019  5:14 PM
+
+BTW, I continue to believe you guys (Steve and Tucker) are wrong about the 
+direct parameter case.
+
+If, in your example, you replace type T2 by:
+
+
+    type T2 is tagged record C : T1 end record;
+
+
+and then consistently replace "access" with "in out" in your example, you 
+get a program that is legal and has the same problem as you are fixing for
+access cases. (Remember, that you can pass a tagged incomplete parameter to 
+another tagged incomplete parameter without seeing the completion, because 
+those have to be by-reference types, and presumably the compiler always knows 
+how to do that regardless of the actual type. That rule was left over from the
+failed Ada 2005 incomplete rules, but it still exists because we didn't want 
+an incompatibility).
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Saturday, June 15, 2019  5:53 PM
+
+Good point.  I had forgotten about this "left over" capability.  So as long 
+as the type is tagged incomplete, then the caller might not have visibility 
+of the full type, so they shouldn't be expected to do the type-invariant 
+check.
+
+****************************************************************
+
+From: Steve Baird
+Sent: Sunday, June 16, 2019  2:04 AM
+
+Ditto.
+
+****************************************************************
+
+From: Steve Baird
+Sent: Sunday, June 16, 2019  2:58 AM
+
+In response to Randy's good point, I withdraw the previously suggested wording 
+change for this AI and suggest the following version instead.
+[This is version /02 of the AI - Editor.]
+
+====
+
+!wording
+
+Add before 7.3.2(21/4):
+
+If the nominal type of a formal parameter (or the designated nominal type of 
+an access-to-object parameter) is incomplete at the point of the declaration 
+of the callable entity, and if the completion of that incomplete type does 
+not occur in the same declaration list as the incomplete declaration, then 
+for purposes of the preceding rules the nominal type is considered to have 
+no parts of type T.
+
+modify 7.3.2(23.a/5)
+     ...  is not itself externally visible. { Incomplete types or
+     class-wide types may be used to produce cases where subcomponents
+     are not checked. } These cases represent holes ...
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent