CVS difference for ai05s/ai05-0015-1.txt

Differences between 1.3 and version 1.4
Log of other versions for file ai05s/ai05-0015-1.txt

--- ai05s/ai05-0015-1.txt	2006/12/16 03:13:17	1.3
+++ ai05s/ai05-0015-1.txt	2007/05/26 01:43:59	1.4
@@ -1,4 +1,4 @@
-!standard 6.5(2.1/2)                                 06-12-13    AI05-0015-1/03
+!standard 6.5(2.1/2)                                 07-05-17    AI05-0015-1/04
 !standard 3.3(10/2)
 !standard 3.3(21)
 !standard 6.5(5/2)
@@ -39,8 +39,8 @@
 Add the optional "constant" reserved word to 6.5(2.1/2):
 
 extended_return_statement ::=
-          return defining_identifier : [aliased] [constant] return_subtype_indication
-       [:= expression] [do
+          return defining_identifier : [aliased] [constant]
+     return_subtype_indication [:= expression] [do
               handled_sequence_of_statements
           end return];
 
@@ -55,12 +55,12 @@
    * the object denoted by a function_call or aggregate;
 
 Add to 6.5(5/2)
-    An extended_return_statement with the reserved word constant shall include an
-    expression.
+    An extended_return_statement with the reserved word constant shall
+    include an expression.
 
 Add to 6.5(5.7/2)
-    An extended_return_statement with the reserved word constant is a full constant
-    declaration for the return object.
+    An extended_return_statement with the reserved word constant is a
+    full constant declaration for the return object.
 
 !discussion
 
@@ -72,7 +72,7 @@
     function F (...) return Limited_Type is
     begin
         return Result: constant -- Illegal!
-          Limited_Type := (Foo => ..., Bar => ...)
+            Limited_Type := (Foo => ..., Bar => ...)
         do
             Print_Trace("Created object " & Image(Result));
             pragma Assert(Some_Property(Result));
@@ -81,10 +81,16 @@
 
     function G (...) return Limited_Type is
     begin
-        return Result : constant Limited_Type := Func(Some_Object) do -- Illegal!
+        return Result : constant Limited_Type -- Illegal as language stands!
+            := Func(Some_Object) do
             Clean_Up(Some_Object);
         end return;
     end G;
+
+Along with the added the keyword constant to the syntax of extended return
+statements, the definition of a constant object needs to be extended to include
+these. We also corrected 3.3(10/2) so it clearly covers the return object of
+a function both inside and after a function call.
 
 !corrigendum 3.3(10/2)
 

Questions? Ask the ACAA Technical Agent