This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Use of names in input_list of aspect/pragma Initializes


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  <kirtchev@adacore.com>

	* sem_prag.adb (Analyze_Input_Item): Emit an
	error when the input item comes from the related package.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]