This patch corrects the analysis of an initialization item with an input_list to catch cases where input items come from the same related package.
------------ -- Source -- ------------ -- init.ads package Init with Abstract_State => S, Initializes => (S => (Emb.SS, Emb.XX, Emb.YY)) is package Emb with Abstract_State => SS is XX : Integer; private YY : Integer; end Emb; end Init; ---------------------------- -- Compilation and output -- ---------------------------- $ gcc -c -gnatd.V init.ads init.ads:3:37: input item "SS" cannot denote a visible variable or state of package "Init" init.ads:3:45: input item "XX" cannot denote a visible variable or state of package "Init" init.ads:3:53: "YY" is not a visible entity of "Emb" Tested on x86_64-pc-linux-gnu, committed on trunk 2013-10-15 Hristian Kirtchev <kirtc...@adacore.com> * sem_prag.adb (Analyze_Input_Item): Emit an error when the input item comes from the related package.
Index: sem_prag.adb =================================================================== --- sem_prag.adb (revision 203568) +++ sem_prag.adb (working copy) @@ -2353,9 +2353,9 @@ if Ekind_In (Input_Id, E_Abstract_State, E_Variable) then -- The input cannot denote states or variables declared - -- within the visible declarations of the package. + -- within the related package. - if Contains (States_And_Vars, Input_Id) then + if In_Same_Code_Unit (Item, Input) then Error_Msg_Name_1 := Chars (Pack_Id); Error_Msg_NE ("input item & cannot denote a visible variable or "