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] Illegal component clause for inherited component in extension


This change fixes the circuitry that handles record representation
clauses so that a component clause for an inherited component in
a record extension is properly rejected (such a clause is illegal
per 13.5.1(9)).

The following compilation must be rejected with the indicated error:
$ gcc -c illegal_clause_for_inherited_comp.ads 
illegal_clause_for_inherited_comp.ads:7:08: component clause not allowed for inherited component "B"

package Illegal_Clause_For_Inherited_Comp is
  type R1 is tagged record
    B  : Boolean;
  end record;
  type R1_Ext is new R1 with null record;
  for R1_Ext use record
    B  at 2 range 63 .. 63;
  end record;
end;

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

2013-01-03  Thomas Quinot  <quinot@adacore.com>

	* sem_ch13.adb (Analyze_Record_Representation_Clause): Reject
	an illegal component clause for an inherited component in a
	record extension.

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]