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 in record aggregates


a component association for component X has a boc, then X is covered in the
aggregate even if there is not default value for X in the type declaration, and
X has to be default-initialized. If the aggregate also has an others clause, X
is not covered by it.

The following must compile quietly in gnat05 mode:

procedure P is
   type R is record
      X : Integer;
      Y : Boolean;
   end record;
   Z : R;
begin
   Z := (X => <>, others => True);
end P;

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

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

	* sem_aggr.adb (Resolve_Record_Aggregate): If a component
	association for component X has a box, then X is covered in the
	aggregate even if there is not default value for X in the type
	declaration, and X has to be default-initialized.

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]