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

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

--- ai12s/ai12-0074-1.txt	2013/06/11 01:01:49	1.2
+++ ai12s/ai12-0074-1.txt	2013/07/09 04:21:54	1.3
@@ -1,4 +1,4 @@
-!standard 4.6(56)                                   13-06-09    AI12-0074-1/01
+!standard 4.6(56)                                   13-06-15    AI12-0074-1/02
 !standard 6.4.1(12)
 !standard 6.4.1(13.1/3)
 !class binding interpretation 13-06-09
@@ -67,7 +67,47 @@
 
 !wording
 
-** TBD.
+Append to end of 6.4.1 Legality Rules section:
+
+   If the mode is *out*, the type of the formal parameter is a
+   a scalar type that has the Default_Value aspect specified,
+   and the actual parameter is a view conversion, then
+     -  the type of the operand of the conversion shall have the
+        Default_Value aspect specified; and
+     -  there shall exist a type (other than a root numeric type) that is
+        an ancestor of both the target type and the operand type.
+   In addition to the places where Legality Rules normally apply
+   (see 12.3), this rule applies also in the private part of an
+   instance of a generic unit.
+
+   AARM note: This rule is needed in order to ensure that a well-defined
+   parameter value is passed in.
+
+Replace 6.4.1(13.1/3)
+
+   For a scalar type that has the Default_Value aspect specified,
+   the formal parameter is initialized from the value of the actual,
+   without checking that the value satisfies any constraint or any
+   predicate;
+
+with
+
+   For a scalar type that has the Default_Value aspect specified,
+   the formal parameter is initialized from the value of the actual,
+   without checking that the value satisfies any constraint or any
+   predicate, except in the following case: if the actual parameter
+   is a view conversion and either
+      - there exists no type (other than a root numeric type) that
+        is an ancestor of both the target type and the type of the
+        operand of the conversion; or
+      - the Default_Value aspect is unspecified for the type of the
+        operand of the conversion
+   then Program_Error is raised;
+
+   [Note: The Program_Error case can only arise in the body of an
+    instance of a generic. Implementations that macro-expand generics
+    can always detect this case when the enclosing instance body is
+    expanded.]
 
 !discussion
 
@@ -156,7 +196,7 @@
 
     Obj : Positive := 1;
 
-    P (Do_It => False, Result => Small); -- (1)
+    P (Do_It => False, Result => Small(Obj)); -- (1)
 
 The call to P at (1) would raise Constraint_Error upon return, even though
 the previously initialized value of Obj is properly initialized and it wasn't

Questions? Ask the ACAA Technical Agent