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] Configuration options lost after processing of separate unit


this patch updates the analysis of package body stubs and subprogram body stubs
to maintain the configuration options of the enclosing context in a stack-like
fasion. This ensures that options pertaining to the proper body do not govern
the options of the enclosing context.

------------
-- Source --
------------

--  pack.ads

package Pack is
   procedure Must_Fail;
end Pack;

--  pack.adb

package body Pack is
   pragma Assertion_Policy (Assert => Check);

   package Pack_Stub is
      procedure Pack_Stub_Proc;
   end Pack_Stub;

   package body Pack_Stub is separate;

   procedure Proc_Stub;
   procedure Proc_Stub is separate;

   procedure Must_Fail is
   begin
      pragma Assert (False);
      null;
   end Must_Fail;
end Pack;

--  pack-pack_stub.adb

separate (Pack)

package body Pack_Stub is
   procedure Pack_Stub_Proc is begin null; end Pack_Stub_Proc;
end Pack_Stub;

--  pack-proc_stub.adb

separate (Pack)

procedure Proc_Stub is begin null; end Proc_Stub;

--  config_opts.adb

with Pack; use Pack;

procedure Config_Opts is
begin
   Must_Fail;
end Config_Opts;

----------------------------
-- Compilation and output --
----------------------------

$ gnatmake -q config_opts.adb
$ ./config_opts
raised SYSTEM.ASSERTIONS.ASSERT_FAILURE : pack.adb:15

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-02-06  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch10.adb (Analyze_Package_Body_Stub): Maintain
	the configuration options of the enclosing context in a
	stack-like fasion.
	(Analyze_Subprogram_Body_Stub): Maintain the
	configuration options of the enclosing context in a stack-like
	fashion.

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]