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] |
When instantiating a nested generic, we must also analyze all previous inner instances contained in the encloing instance, to ensure that the same set of public symbols is generated under all circumstances. Instantiations declared within a generic body must be excluded from this. The following must compile quietly with -O1 or higher optimization levels. --- with Services; package P is new Services.Generic_Service_B; --- package Services is generic package Generic_Service_A is procedure Attach; end; generic package Generic_Service_B is end; end; --- package body Services is generic package Service_A_Support is end; package body Service_A_Support is type Wint is record Value : aliased Integer := 0; end record; type Warray is array (1 .. 1) of Wint; type Wrecord is record Value : Warray; end record; end; package body Generic_Service_A is package Support is new Service_A_Support; procedure Attach is begin null; end; end; generic package Service_B_Generic_Support is generic package Reception_Generic is procedure Attach; end; end; package body Service_B_Generic_Support is generic package Generic_Reception_Generic is end; package body Generic_Reception_Generic is task Sc_Data_Pump is end; task body Sc_Data_Pump is begin null; end; end; package body Reception_Generic is package Generic_Reception is new Generic_Reception_Generic; procedure Attach is begin null; end Attach; end; end; package Service_B_Support is new Service_B_Generic_Support; package body Generic_Service_B is package Support is new Service_B_Support.Reception_Generic; end; end; Tested on x86_64-pc-linux-gnu, committed on trunk 2009-06-22 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Collect_Previous_Instances): Do not collect instantiations declared in a previous generic package body.
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] |