CVS difference for ais/ai-00269.txt

Differences between 1.1 and version 1.2
Log of other versions for file ais/ai-00269.txt

--- ais/ai-00269.txt	2001/05/26 02:55:11	1.1
+++ ais/ai-00269.txt	2001/09/19 00:04:39	1.2
@@ -1,4 +1,4 @@
-!standard  4.09 (29)                                   01-05-25  AI95-00269/01
+!standard  4.09 (29)                                   01-09-18  AI95-00269/02
 !class binding interpretation 01-02-22
 !status work item 01-05-25
 !status received 01-03-23
@@ -10,12 +10,13 @@
 !summary
 
 If a formal in object is associated with a static actual, uses of the formal
-object within the instance are static.
+object declared in an instance outside of that instance are static.
 
 !question
 
 Is the use of a formal object within a generic instance treated as static if
-the formal object is associated with a static actual? (Yes, in the spec.)
+the formal object is associated with a static actual? (Yes, when used outside
+of the instance.)
 
 Consider the following example:
 
@@ -50,14 +51,45 @@
 
 !discussion
 
+AI83-00001 concludes that, outside the instance, an expression is static
+if all the names in this expression "denote" static things.
 
-!corrigendum xx.xx(xx)
+However, 4.9(24) says that a static constant is declared by a full constant
+declaration. But a formal object in an instance is not declared by a full
+constant declaration, and thus a formal object can never be static. This would
+be a significant incompatibility with Ada 83.
+
+Thus, formal objects with static actual expressions should be treated as
+static in the instance. However, we need to be careful. We do not want to
+require exact evaluation for expressions static because of a formal object
+inside of the generic unit, because that would interfere with generic sharing.
+We also do not want to trigger the rounding rule of 4.9(38). Note that
+generic formal objects cannot be used in a context where a static expression is
+required inside of the generic, as legality rules are checked in the generic
+unit based on the properties of the formal (see 12.3(11)). Thus, any such
+use would be illegal in the generic unit.
 
+!corrigendum 4.09(24)
+
 @drepl
+A @i<static constant> is a constant view declared by a full constant
+declaration or an @fa<object_renaming_declaration> with a static nominal
+subtype, having a value defined by a static scalar expression or by a
+static string expression whose value has a length not exceeding the maximum
+length of a @fa<string_literal> in the implementation.
 @dby
+A @i<static constant> is a constant view declared by a full constant
+declaration, an @fa<object_renaming_declaration> with a static nominal
+subtype, or generic formal object of mode @b<in> declared in an instance and
+used outside of the instance having a value defined by a static scalar
+expression or by a static string expression whose value has a length not
+exceeding the maximum length of a @fa<string_literal> in the implementation.
 
 !ACATS test
 
+Legacy tests A49027A, A49027B, and A49027C test cases where items that are
+non-static in the generic specification are static in the instance
+specification.
 
 !appendix
 
@@ -916,6 +948,22 @@
 Can you point to this AI, it would help inform the current discussion, and
 in some sense would be decisive on the issue, since we intend to be back
 compatible with both the Ada 83 RM and relevant AI's.
+
+****************************************************************
+
+From: Pascal Leroy
+Sent: Thursday, March 29, 2001 6:23 AM
+
+> Can you point to this AI, it would help inform the current discussion, and
+> in some sense would be decisive on the issue, since we intend to be back
+> compatible with both the Ada 83 RM and relevant AI's.
+
+AI83-00001 makes a subtle-but-significant distinction between "denotes" and
+"declares".  RM83 12.3(6-14) then uses "denotes" all over the place.  The
+conclusion is that, outside the instance, an expression is static if all the
+names in this expression "denote" static things.  (I must admit that 15 years
+later the logic seems a bit tenuous, but it was quite convincing at the time.)
+This was deemed important for the usability of generics.
 
 ****************************************************************
 

Questions? Ask the ACAA Technical Agent