Commit 26168a32 by Hristian Kirtchev Committed by Arnaud Charlet

sem_prag.adb (Check_Mode): Do not emit an error when inspecting a self…

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

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
parent c852a0a9
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> 2013-10-14 Tristan Gingold <gingold@adacore.com>
* exp_prag.adb (Expand_Pragma_Import_Export_Exception): Fix * exp_prag.adb (Expand_Pragma_Import_Export_Exception): Fix
......
...@@ -928,6 +928,15 @@ package body Sem_Prag is ...@@ -928,6 +928,15 @@ package body Sem_Prag is
Error_Msg_NE ("item & must have mode in out", Item, Item_Id); Error_Msg_NE ("item & must have mode in out", Item, Item_Id);
end if; 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 -- Self-referential parameter
elsif Ekind (Item_Id) /= E_In_Out_Parameter then elsif Ekind (Item_Id) /= E_In_Out_Parameter then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment