From: Hristian Kirtchev Date: Mon, 14 Oct 2013 13:21:37 +0000 (+0000) Subject: sem_prag.adb (Check_Mode): Do not emit an error when inspecting a self referencial... X-Git-Tag: releases/gcc-4.9.0~3505 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=26168a32da1ef7e75c8f2f6b557d8ecce17e43b9;p=thirdparty%2Fgcc.git sem_prag.adb (Check_Mode): Do not emit an error when inspecting a self referencial output item of an... 2013-10-14 Hristian Kirtchev * sem_prag.adb (Check_Mode): Do not emit an error when inspecting a self referencial output item of an unconstrained type. From-SVN: r203545 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index dcad0df960a1..5462077b49b3 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2013-10-14 Hristian Kirtchev + + * 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 * exp_prag.adb (Expand_Pragma_Import_Export_Exception): Fix diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 21e476599fcf..fc263c22c3de 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -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