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

Differences between 1.8 and version 1.9
Log of other versions for file ai12s/ai12-0030-1.txt

--- ai12s/ai12-0030-1.txt	2013/07/16 23:51:27	1.8
+++ ai12s/ai12-0030-1.txt	2013/07/20 01:08:50	1.9
@@ -1,4 +1,4 @@
-!standard 12.5.1(21/3)                               13-07-16    AI12-0030-1/05
+!standard 12.5.1(21/3)                               13-07-19    AI12-0030-1/06
 !standard 13.13.2(49/2)
 !class binding interpretation 12-07-15
 !status Amendment 202x 13-07-16
@@ -84,9 +84,10 @@
 [Editor's note: We have to use the plural version of this boilerplate text as
 there are two rules in this paragraph, and we want this to apply to both.]
 
-For an untagged nonderived type having a task, protected, or explicitly limited record
-part, the default implementation of each of the Read, Write, Input, and Output attributes
-raises Program_Error and performs no other action.
+Unless inherited from a parent type, if any, for an untagged type having a task,
+protected, or explicitly limited record part, the default implementation of
+each of the Read, Write, Input, and Output attributes raises Program_Error and
+performs no other action.
 
    AARM note: It might seem that there is no need to specify the
    behavior of the default implementation of a streaming attribute of,
@@ -160,9 +161,10 @@
 In addition to the places where Legality Rules normally apply (see 12.3),
 these rules also apply in the private part of an instance of a generic unit.
 
-For an untagged nonderived type having a task, protected, or explicitly limited record
-part, the default implementation of each of the Read, Write, Input, and Output attributes
-raises Program_Error and performs no other action.
+Unless inherited from a parent type, if any, for an untagged type having a
+task, protected, or explicitly limited record part, the default implementation
+of each of the Read, Write, Input, and Output attributes raises Program_Error
+and performs no other action.
 
 
 !ACATS test
@@ -824,5 +826,90 @@
 
 Steve has already written this AI up, so we don't need to discuss it further, I
 just wanted to put on the record that TT-1 was not supported by the Standard.
+
+****************************************************************
+
+Summary of private mail thread, July 19th, 2013
+
+Randy Brukardt asks:
+
+The wording we added in AI12-0030-1 (will be 13.13.2(49.1/4) starts:
+
+"For an untagged nonderived type having a task, protected, or explicitly
+limited record part ..."
+
+The example of the question of the AI starts:
+
+      type Lim is limited null record; 
+
+      type Dlim is new Lim; -- does not inherit Lim'Read
+
+      procedure Read_Lim
+        (Stream : not null access Ada.Streams.Root_Stream_Type'Class;
+         Item   : out Lim) is null;
+
+      for Lim'Read use Read_Lim;
+
+Note that type Dlim, for which we need this rule to define the stream
+attributes runtime behavior, is a derived type. Thus the new rule does not
+apply to Dlim.
+
+OK, perhaps inheritance will fix us. Let's look at 13.13.2(8.1/3):
+
+"For an untagged derived type, the Write (resp. Read) attribute is inherited
+according to the rules given in 13.1 if the attribute is specified and
+available for the parent type at the point where T is declared." (T here
+refers to the type of the attribute.)
+
+So this doesn't apply, either, as the attribute is not specified at the point
+where T is declared.
+
+So precisely how does this wording make the example in the question raise
+Program_Error? I'd say that it does not.
+
+Steve Baird replies:
+
+> ... Thus the new rule does not apply to Dlim.
+
+Ok, no problem so far. This is as I would expect.
+
+...
+> So this doesn't apply, either, as the attribute is not specified at 
+> the point where T is declared.
+
+Oh ugh. I thought the "raise P_E" streaming attributes would be inherited.
+That's how this case is supposed to work.
+
+[Followed a by a long diversion into a solution that doesn't work as proposed.]
+
+Randy:
+
+We could patch up the original rule by modifying the new 13.13.2(49.1/4) rule
+as follows:
+
+"{Unless inherited from a parent type, if any, for}[For] an untagged
+[nonderived] type having a task, protected, or explicitly limited record part,
+the default implementation of each of the Read, Write, Input, and Output
+attributes raises Program_Error and performs no other action."
+
+I would have preferred that you have simply followed the existing pattern and
+somehow worked your new rule in as what the default implementation is defined
+to do (that is, as new bullets following 13.13.2(9.1/3) and 13.13.2(27/3)),
+but that would be more than an Editorial Review fix.
+
+Tucker Taft:
+
+Seems fine to me.
+
+Steve:
+
+Ditto.
+
+Jeff Cousins:
+
+I'm not sure about this one, but changing something in 13.3.2 seems preferable
+to changing 13.1.
+
+[So this was done in version /06 of the AI - Editor.]
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent