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] Box associations for components without defaults in aggregates


Box associations are used to initialize aggregate components through the default
value of the corresponding components, or through calls to initialization
procedures. In general aggregates with such initializations cannot be built
statically. With this patch the following must compile quietly:

   gcc -c -gnat05 p.adb

---
procedure P is
   type A1 is array (1 .. 2, 1 .. 2) of Integer;
   A : A1;
begin
   A := ((1 => 2, others => <>), (others => 0));
end P;

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

2011-10-13  Ed Schonberg  <schonberg@adacore.com>

	* exp_aggr.adb (Flatten): If a component association has a box,
	assume that aggregate is not static.
	(Safe_Aggregate): If a component association in a non-limited
	aggregate has a box, assume that it cannot be expanded in place.

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]