2009-07-13 Ed Schonberg <schonberg@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jul 2009 10:09:44 +0000 (10:09 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Jul 2009 10:09:44 +0000 (10:09 +0000)
* exp_attr.adb (Rewrite_Stream_Proc_Call): When rewriting a stream
attribute into a call of the corresponding suprogram, create extra
formals for the subprogram, because it may be a renaming whose
analysis does not create extra formals.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149564 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/exp_attr.adb

index 46f59b8..03680cc 100644 (file)
@@ -1,3 +1,10 @@
+2009-07-13  Ed Schonberg  <schonberg@adacore.com>
+
+       * exp_attr.adb (Rewrite_Stream_Proc_Call): When rewriting a stream
+       attribute into a call of the corresponding suprogram, create extra
+       formals for the subprogram, because it may be a renaming whose
+       analysis does not create extra formals.
+
 2009-07-13  Emmanuel Briot  <briot@adacore.com>
 
        * gnatcmd.adb, prj-proc.adb, prj-proc.ads, make.adb, prj-part.adb,
index c225985..2df553c 100644 (file)
@@ -593,6 +593,14 @@ package body Exp_Attr is
             end if;
          end if;
 
+         --  The stream operation to call maybe a renaming created by
+         --  an attribute definition clause, and may not be frozen yet.
+         --  Ensure that it has the necessary extra formals.
+
+         if not Is_Frozen (Pname) then
+            Create_Extra_Formals (Pname);
+         end if;
+
          --  And now rewrite the call
 
          Rewrite (N,