CVS difference for ais/ai-00382.txt
--- ais/ai-00382.txt 2004/11/02 01:50:30 1.3
+++ ais/ai-00382.txt 2004/12/09 19:55:37 1.4
@@ -1,5 +1,7 @@
-!standard 8.6(17) 04-10-12 AI95-00382/02
+!standard 8.6(17) 04-12-01 AI95-00382/03
!class amendment 04-08-27
+!status Amendment 200Y 04-12-01
+!status ARG Approved 8-0-2 04-11-19
!status work item 04-08-27
!status received 04-08-27
!priority Medium
@@ -8,15 +10,15 @@
!summary
-(See Proposal.)
+(See proposal.)
!problem
AI95-00230 introduces the capability to use anonymous access types in a number
-of new contexts, in particular in component_definitions. It appears however
-that the current instance rule of 8.6(17) creates illegalities when an anonymous
-access type is used as the type of a component. This is demonstrated by the
-following example, excerpted from AI95-00230:
+of new contexts, in particular in component_definitions. It appears however
+that the current instance rule of 8.6(17) creates illegalities when an
+anonymous access type is used as the type of a component. This is demonstrated
+by the following example, excerpted from AI95-00230:
type Obj is
record
@@ -24,19 +26,17 @@
Next : access Obj;
end record;
-This example is likely to be very typical of user code, as linked structure are
-ubiquitous. Therefore, one would very much like it to be legal, as it avoids
-the declaration of a named access type. However, the current instance rule
-states that Obj in the record type declaration is the name of an object or
-value, so the construct "access Obj" is meaningless and therefore illegal.
+This example is likely to be very typical of user code, as linked structures
+are ubiquitous. Therefore, one would very much like it to be legal, as it
+avoids the declaration of a named access type. However, the current instance
+rule states that Obj in the record type declaration is the name of an object
+or value, so the construct "access Obj" is meaningless and therefore illegal.
!proposal
We are changing the current instance rule for type so that the type name
occurring in a access_definition does not denote the current instance of the
-type, but rather the type itself. We only do this for access-to-object types.
-The type name occurring as the parameter or result type for an (anonymous)
-access-to-subprogram type is still illegal.
+type, but rather the type itself.
Note that we are not changing the rules for named access types (the current
instance problem for named access types can only occur in task and protected
@@ -49,7 +49,7 @@
M : Integer;
Next : access Obj; -- Legal
Callback1 : access procedure (X : access Obj); -- Legal
- Callback2 : access procedure (X : Obj); -- Illegal
+ Callback2 : access procedure (X : Obj); -- Legal
end record;
task type T;
@@ -73,8 +73,8 @@
type (rather than the type itself); the current instance of a type is the object
or value of the type that is associated with the execution that evaluates the
usage name. This rule does not apply if the usage name appears within the
-subtype_mark of an access_definition for an access-to-object type, or of a
-parameter of an access-to-subprogram type.
+subtype_mark of an access_definition for an access-to-object type, or within
+the subtype of a parameter or result of an access-to-subprogram type.
AARM NOTE: The phrase "within the subtype_mark" is intended to cover a case like
"access T'Class" appearing within the declarative region of T: here T denotes
@@ -82,7 +82,7 @@
!discussion
-See proposal.
+(See proposal.)
!example
@@ -93,9 +93,25 @@
record
M : Integer;
Next : access Obj;
- end record;"
+ end record;
+
+!corrigendum 8.6(17)
---!corrigendum
+@drepl
+If a usage name appears within the declarative region of a @fa<type_declaration>
+and denotes that same @fa<type_declaration>, then it denotes the @i<current
+instance> of the type (rather than the type itself). The current instance of a
+type is the object or value of the type that is associated with the execution
+that evaluates the usage name.
+@dby
+If a usage name appears within the declarative region of a @fa<type_declaration>
+and denotes that same @fa<type_declaration>, then it denotes the @i<current
+instance> of the type (rather than the type itself); the current instance of a
+type is the object or value of the type that is associated with the execution
+that evaluates the usage name. This rule does not apply if the usage name
+appears within the @fa<subtype_mark> of an @fa<access_definition> for an
+access-to-object type, or within the subtype of a parameter or result of an
+access-to-subprogram type.
!ACATS test
Questions? Ask the ACAA Technical Agent