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

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

--- ai12s/ai12-0186-1.txt	2016/04/22 03:41:42	1.2
+++ ai12s/ai12-0186-1.txt	2016/10/05 23:25:17	1.3
@@ -1,4 +1,4 @@
-!standard 13.14(15)                                 16-04-21  AI12-0186-1/01
+!standard 13.14(15)                                 16-10-04  AI12-0186-1/02
 !class ramification 16-04-21
 !status work item 16-04-21
 !status received 16-01-09
@@ -45,61 +45,51 @@
   * When a subprogram is used as an actual parameter to a generic
     instantation - 13.14(10.2/4).
 
-A reference to an Access attribute is definitely not a place where the profile
-of a subprogram is frozen.
+A reference to an Access attribute was definitely not intended to be a place
+where the profile of a subprogram is frozen.
 
-The questioner has misinterpreted 13.14(15). The "expressions and names" it is
-talking about are those that explicitly appear directly in the syntax of the
-full_type_declaration; it does not refer to names that appear in other entities
-that happen to occur in the full_type_declaration.
-
-This is easy to see. First, if any name was involved, none of the wording about
-subtypes would be necessary (every subtype_indication includes a number of names
-and expressions). Typically, the AARM marks text that is intentionally
-redundant, and this text is not marked.
-
-Even more obviously, AARM 13.14(15.b) says that "Freezing an access type does
-not freeze its designated subtype." If the names that occurred within a
-subtype_indication were included in 13.14(15), it would be impossible for
-this to be true:
-   type Ptr2 is access Blob;
-This full_type_declaration does not freeze Blob, even though the "name" Blob
-appears in the subtype_indication of the access_type_definition.
-
-Finally, this wording ("any expressions or names within the full type
-definition cause freezing") has been in every version of since the very early
-drafts of Ada 9x (it appears in version 2.0 of March 1993). It is impossible
-to believe that every Ada expert since that time has been misreading this
-paragraph.
+Unfortunately, the wording of 13.14(15) is somewhat unclear. The original
+intent was that "names" referred to object names and other names that appear
+within expressions, but not subtype_marks except those that were explicitly
+enumerated (parent subtype, component subtype, etc.). We agree the wording
+should be clarified.
 
-As such, there is nothing wrong with the Standard. We add a To Be Honest note
-in order to clarify the wording for anyone that remains confused.
-
 !wording
-
-Add before AARM 13.14(15.a):
 
-AARM To Be Honest:
+Modify 13.14(15):
 
-The "expressions or names within the full_type_declaration" is speaking
-syntactically; any expressions or names inside of other entities appearing in
-the type declaration are not considered. In particular, the parts of any
-subtype_marks or subtype_indications appearing in full_type_declaration
-are frozen only if this rule specifies that the associated subtype is
-frozen. (For instance, subtypes appearing in profiles and in designated types
-are not frozen by this rule.)
+  At the place where a subtype is frozen, its type is frozen. At the
+  place where a type is frozen, any expressions or names within the full
+  type definition cause freezing{, other than those that occur within an
+  access_type_definition or an access_definition}; the first subtype,
+  and any component subtypes, index subtypes, and parent subtype of the
+  type are frozen as well. For a specific tagged type, the corresponding
+  class-wide type is frozen as well. For a class-wide type, the
+  corresponding specific type is frozen as well.
 
 !discussion
 
-There clearly is some implementation impact from being able to use the
-Access attribute for a subprogram with an unfrozen profile. In particular,
-if a wrapper is needed, that will have to be deferred (at least) until the
-freezing point of the profile.
-
-However, Ada 2012 already has similar requirements for incomplete types (which
-are never frozen, confirmed by AI12-0155-1). For a Taft-amendment type, the
-real profile of a subprogram may not be known until the body is compiled, long
-after the specification is compiled. For instance:
+The intent of 13.14(15) was that the only subtypes that were frozen as a
+side-effect of freezing a type were enumerated directly (parent subtype,
+component subtypes, etc.). But the term "name" is very general, and
+names appear within subtype_marks in particular. So we clarify that any
+names or expressions occurring within an access[_type]_definition do not
+cause freezing even if they appear within the full type definition of a
+type being frozen. Note that the designated subtype, and the designated
+profile, are frozen at a later point, as explained in 13.14(13) and
+13.14(10.1/4) respectively.
+
+One implication of this is that 'Access does not freeze the profile of
+the corresponding access-to-subprogram type. There clearly is some
+implementation impact from being able to use the Access attribute for a
+subprogram with an unfrozen profile. In particular, if a wrapper is
+needed, that will have to be deferred (at least) until the freezing
+point of the profile.
+
+However, Ada 2012 already has similar requirements for incomplete types
+(which are never frozen, confirmed by AI12-0155-1). For a Taft-amendment
+type, the real profile of a subprogram may not be known until the body
+is compiled, long after the specification is compiled. For instance:
 
     package P1 is
         type T is private;
@@ -375,5 +365,26 @@
 
 In Pisa it might be more appropriate to drop them from the leaning tower and
 see which lands first... ;-)
+
+****************************************************************
+
+From: Tucker Taft
+Sent: Tuesday, October 4, 2016  9:42 PM
+
+Here is an update. [This is version /02 of the AI - Editor.]
+It is surprising that paragraph 13.14(15) could have been
+so misleading for so long, as far as what happens when you freeze an access
+type.  The answer is that the names and expressions inside the
+access[_type]_defininition do not cause freezing.  That only happens when the
+designated subtype/profile is frozen.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Wednesday, October 5, 2016  6:24 PM
+
+Procedural: This AI is no longer a ramification if it changes normative
+wording in the Standard. (Ramifications can only change notes, examples,
+and the AARM.) It needs to be reclassified as a Binding Interpretation.
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent