CVS difference for ais/ai-00332.txt

Differences between 1.3 and version 1.4
Log of other versions for file ais/ai-00332.txt

--- ais/ai-00332.txt	2003/11/27 02:01:16	1.3
+++ ais/ai-00332.txt	2004/12/09 19:55:30	1.4
@@ -1,5 +1,7 @@
-!standard  4.7  (03)                                   03-11-25  AI95-00332/03
+!standard  8.6  (27)                                   04-12-02  AI95-00332/04
 !class binding interpretation 03-07-25
+!status Amendment 200Y 04-12-02
+!status ARG Approved 8-0-2  04-11-21
 !status work item 03-07-25
 !status received 03-03-17
 !qualifier Omission
@@ -15,7 +17,7 @@
 
 !question
 
-Which of the following allocators is legal?
+Which of the following allocators is legal? (Neither.)
 
     procedure test47 is
         type T1 is tagged null record;
@@ -27,8 +29,8 @@
             P1 : T1_Acc;
             P2 : T1_Class_Acc;
         begin
-            P1 := new T1' (Y);        -- IS THIS LEGAL?
-            P2 := new T1'Class' (X);  -- IS THIS LEGAL?
+            P1 := new T1' (Y);        -- IS THIS LEGAL? (No.)
+            P2 := new T1'Class' (X);  -- IS THIS LEGAL? (No.)
         end Proc;
 
     begin
@@ -79,21 +81,21 @@
 When a construct is one that requires that its expected type be a *single* type
 in a given class, the type of the construct shall be determinable solely from
 the context in which the construct appears, excluding the construct itself, but
-using the requirement that it be in the given class; the expected type of the
-construct is then this type. Furthermore, the context shall not be one that
-expects any type in some class that contains types of the given class; in
-particular, the construct shall not be the operand of a type_conversion.
+using the requirement that it be in the given class. Furthermore, the context
+shall not be one that expects any type in some class that contains types of
+the given class; in particular, the construct shall not be the operand of a
+type_conversion.
 
 AARM Note:
 
 The part of the first sentence after the semicolon serves to define
 the "expected type" for constructs that don't have one (like qualified
-expressions and renames). Otherwise, such constructs wouldn't allow aggregates
-and 'Access.
+expressions and renames). Otherwise, such constructs wouldn't allow aggregates,
+'Access, and so on.
 
 !discussion
 
-Clearly we want the Access attribute, null, character literals, and so on,
+Clearly we want the Access attribute, character literals, and so on,
 to work in qualified expressions. The entire point of qualified expressions
 is to resolve ambiguity in expressions, and the purpose would be severely
 compromised if some types of expressions could not be used in them.
@@ -105,14 +107,24 @@
 
 Just changing the definition of qualified expression doesn't work, however.
 First, there are other such constructs for objects (object renames and
-selected components come to mind). Fixing every one of them seems like a pain.
-prohibitive. Second, just defining the expected type of a qualified expression
+selected components come to mind). Fixing every one of them seems prohibitive.
+Second, just defining the expected type of a qualified expression
 would trigger the rules of 8.6(22-25). But we definitely do not want the
 operand of a qualified expression to be a classwide type if the qualifying type
 is a specific type. Moreover, a legality rule would make some qualified
 expressions ambiguous, which would make qualified expressions less useful for
-their primary purpise of eliminating ambiguity.
+their primary purpose of eliminating ambiguity.
 
+The new wording solves the problem, in that it only mentions
+"expected type" as part of identifying the case we are talking about,
+but doesn't require that the context actually *provide* such an expected
+type. The trailing phrase "the type of the construct
+is then this single expected type" was dropped, as it seems unnecessary with
+this new wording. The second sentence rules out cases
+where any type in a class is expected, which might require overload
+resolution to deal with cases where there just happens to be only
+one such type in scope.
+
 !corrigendum 8.6(27)
 
 @drepl
@@ -125,13 +137,13 @@
 class; in particular, the construct shall not be the operand of a
 @fa<type_conversion>.
 @dby
-When a construct is one that requires that its expected type be a @fa<single> type
+When a construct is one that requires that its expected type be a @i<single> type
 in a given class, the type of the construct shall be determinable solely from
 the context in which the construct appears, excluding the construct itself, but
-using the requirement that it be in the given class; the expected type of the
-construct is then this type. Furthermore, the context shall not be one that
-expects any type in some class that contains types of the given class; in
-particular, the construct shall not be the operand of a @fa<type_conversion>.
+using the requirement that it be in the given class. Furthermore, the context
+shall not be one that expects any type in some class that contains types of
+the given class; in particular, the construct shall not be the operand of a
+@fa<type_conversion>.
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent