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

Differences between 1.4 and version 1.5
Log of other versions for file ai12s/ai12-0409-1.txt

--- ai12s/ai12-0409-1.txt	2020/12/17 04:12:46	1.4
+++ ai12s/ai12-0409-1.txt	2021/01/15 07:40:06	1.5
@@ -1,4 +1,4 @@
-!standard 10.2.1(4.1/2)                                20-12-15  AI12-0409-1/03
+!standard 10.2.1(4.1/2)                                20-12-18  AI12-0409-1/04
 !standard 10.2.1(4.2/2)
 !standard 10.2.1(11.1/2)
 !standard 10.2.1(11.2/2)
@@ -6,7 +6,6 @@
 !standard 10.2.1(11.7/2)
 !standard 10.2.1(11.8/2)
 !standard 13.1(11/3)
-!standard J.15.14(0)
 !standard A.18.19(5/5)
 !standard A.18.20(5/5)
 !standard A.18.21(5/5)
@@ -15,6 +14,7 @@
 !standard A.18.24(5/5)
 !standard A.18.25(5/5)
 !standard A.18.32(6/5)
+!standard J.15.14(0)
 !class Binding Interpretation 20-12-09
 !status Amendment 1-2012 20-12-11
 !status ARG Approved 11-0-3  20-12-09
@@ -162,6 +162,12 @@
     more formal types visible at the point of the declaration of the
     composite type, conjoined with "and".
 
+    AARM Ramification: "Formal types visible at the point of 
+    the declaration" includes all visible formal types, including 
+    those that might have been declared in formal packages or in 
+    child packages.
+
+
 Modify 10.2.1(11.7/3):
 
   [If the pragma appears in the first
@@ -176,12 +182,12 @@
   shall not have entries, and each component of the protected type shall
   have preelaborable initialization. {If the aspect is specified True
   for a generic formal type, then in a generic_instantiation the
-  corresponding actual type shall have preelaborable initialization. If
-  the aspect is specified to be the conjunction of one or more
-  Preelaborable_Initialization attribute references, then the full view
-  of the type shall have preelaborable initialization presuming the
-  types mentioned in the conjunction all have preelaborable
-  initialization.} For any other composite type, the [type shall have
+  corresponding actual type shall have preelaborable initialization. If 
+  the aspect definition includes one or more Preelaborable_Initialization
+  attribute references, then the full view of the type shall have
+  preelaborable initialization presuming the types mentioned in the
+  prefixes of the attribute references all have preelaborable initialization.}
+  For any other composite type, the [type shall have
   preelaborable initialization]{aspect shall be 
   specified statically True or False only if it is confirming}. In
   addition to the places where Legality Rules normally apply (see 12.3),
@@ -308,7 +314,7 @@
   is True. This pragma shall appear in the visible part of a package or
   generic package.
 
-  If the pragma appears in the first list of basic_declarative_items of
+  If the pragma appears in the first declaration list of
   a package_specification, then the direct_name shall denote the first
   subtype of a composite type, and the type shall be declared
   immediately within the same package as the pragma. The composite type
@@ -356,10 +362,58 @@
 automatic rule, but none of them seemed as simple as this approach, which 
 seemed both intuitive and readable.
 
+(3) This aspect does not have the generalized design of aspects like 
+Static_Predicate. For instance, one cannot combine a static expression and
+a Preelaborable_Initialization aspect; one cannot use a attribute of a formal
+type of an outer generic to define the aspect of an inner generic; one cannot
+specify that a non-private type does not have preelaborable initialization if
+the full definition indeed has preelaborable initialization (while that is
+allowed for a private type); and the aspect is defined for elementary types
+but it cannot be set or queried.
+
+We could have created a more general feature, but that would have added more
+complexity for marginally more functionality (none of the cases mentioned
+above seem very likely). Moreover, this is built upon the existing 
+preelaborable initialization pragma, which could only be specified in even
+more limited circumstances. So there would be a greater chance of introducing
+problems with a wider generalization. As such, we opted for practicality over
+the more usual generalization that we usually persue with Ada.
+
 !examples
 
 See the updates to A.18.19-25 above.
 
+!corrigendum J.15.14(0)
+
+@dinsc
+
+@s8<@i<Syntax>>
+
+The form of a @fa<pragma> Preelaborable_Initialization is as follows: 
+
+@xindent<@ @ @b<pragma> Preelaborable_Initialization (@fa<direct_name>);>
+
+@s8<@i<Legality Rules>>
+
+A pragma Preelaborable_Initialization specifies that the
+Preelaborable_Initialization aspect (see 10.2.1) for a composite type
+is True. This pragma shall appear in the visible part of a package or
+generic package.
+
+If the pragma appears in the first declaration list of
+a @fa<package_specification>, then the @fa<direct_name> shall denote the first
+subtype of a composite type, and the type shall be declared
+immediately within the same package as the pragma. The composite type
+shall be one for which the Preelaborable_Initialization aspect can be
+directly specified as True. 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.
+
+If the pragma appears in a @fa<generic_formal_part>, then the @fa<direct_name>
+shall denote a type declared in the same @fa<generic_formal_part> as the
+pragma, and be one for which the Preelaborable_Initialization aspect
+can be directly specified as True.
+
 !ASIS
 
 [Not sure. Probably the attribute needs to be added to some enumeration,
@@ -380,6 +434,13 @@
 some other method to make bounded containers legal, we do not want to require
 them to change it.)
 
+However, it is OK for an Ada 2012 C-Test to require that a bounded container
+has preelaborable initialization assuming that the element type has
+preelaborable initialization. It is also OK for an Ada 2012 C-Test to require
+that a bounded container can be instantiated with an element type that does
+not have preelaborable initialization (the container type should only be
+used in contexts that do not require preelaborable initialization).
+
 !appendix
 
 !topic Bounded containers cannot be implemented in Ada
@@ -1152,5 +1213,50 @@
     initialization, but they cannot have {the aspect}
     Preelaborable_Initialization {specified True for}
     them.
+
+****************************************************************
+
+Editor, December 18, 2020
+
+In the new Annex J subclause, we had:
+
+If the pragma appears in the first list of basic_declarative_items of
+a package_specification ...
+
+7.1(6/2) defines a "list of basic_declarative_items" to be a "declaration
+list". That term is relatively new, so it probably wasn't used in 10.2.1,
+but there's no reason to use the longer description now.
+
+It would be tempting to replace all of this with "visible part", but that
+unfortunately (for this use) includes the formal part (see 8.2), which we
+don't want here.
+
+---
+
+I replaced (after consulting with Tucker Taft):
+
+If the aspect is specified to be the conjunction of one or more
+Preelaborable_Initialization attribute references, then the full view
+of the type shall have preelaborable initialization presuming the
+types mentioned in the conjunction all have preelaborable
+initialization.
+
+with:
+
+If the aspect definition includes one or more 
+Preelaborable_Initialization attribute references, then the 
+full view of the type shall have preelaborable initialization 
+presuming the types mentioned in the prefixes of the 
+attribute references all have preelaborable initialization.
+
+It's better not to use a "big word" like "conjunction" as it causes the
+reader to pause and wonder if that is a term or used in an English sense (and
+possibly look up the English sense); more importantly, it's not at all clear
+which types are "mentioned in the conjunction". The slightly longer version
+given here clarifies that and otherwise simplifies the wording.
+
+---
+
+I've treated these as my editorial review.
 
 ****************************************************************

Questions? Ask the ACAA Technical Agent