]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_prag.adb (Check_Mode): Do not emit an error when inspecting a self referencial...
authorHristian Kirtchev <kirtchev@adacore.com>
Mon, 14 Oct 2013 13:21:37 +0000 (13:21 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 14 Oct 2013 13:21:37 +0000 (15:21 +0200)
2013-10-14  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_prag.adb (Check_Mode): Do not emit an
error when inspecting a self referencial output item of an
unconstrained type.

From-SVN: r203545

gcc/ada/ChangeLog
gcc/ada/sem_prag.adb

index dcad0df960a15ea581b1e4f8a304d4b86e5bfa50..5462077b49b3e9b33f7da719d1116524376cba29 100644 (file)
@@ -1,3 +1,9 @@
+2013-10-14  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_prag.adb (Check_Mode): Do not emit an
+       error when inspecting a self referencial output item of an
+       unconstrained type.
+
 2013-10-14  Tristan Gingold  <gingold@adacore.com>
 
        * exp_prag.adb (Expand_Pragma_Import_Export_Exception): Fix
index 21e476599fcf58cd91c071efcb3fe0b012991b79..fc263c22c3de7f64c35a25e521330a9df2248204 100644 (file)
@@ -928,6 +928,15 @@ package body Sem_Prag is
                   Error_Msg_NE ("item & must have mode in out", Item, Item_Id);
                end if;
 
+            --  A self-referential out parameter of an unconstrained or tagged
+            --  type acts as an input because the discriminants, array bounds
+            --  or the tag may be read.
+
+            elsif Ekind (Item_Id) = E_Out_Parameter
+              and then Is_Unconstrained_Or_Tagged_Item (Item_Id)
+            then
+               null;
+
             --  Self-referential parameter
 
             elsif Ekind (Item_Id) /= E_In_Out_Parameter then