Commit 7d7af38a by Javier Miranda Committed by Arnaud Charlet

sem_ch3.ads, [...] (Check_Abstract_Overriding): Avoid generation of spurious…

sem_ch3.ads, [...] (Check_Abstract_Overriding): Avoid generation of spurious error if parent is an interface type...

2007-12-06  Javier Miranda  <miranda@adacore.com>
	    Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.ads, sem_ch3.adb (Check_Abstract_Overriding): Avoid
	generation of spurious error if parent is an interface type; caused
	because predefined primitive bodies will be generated later by
	Freeze_Record_Type.
	(Process_Subtype): The subtype inherits the Known_To_Have_Preelab_Init
	flag.
	(Derive_Subprograms): Handle derivations of predefined primitives
	after all the user-defined primitives to ensure that they are
	found in proper order in instantiations.
	(Add_Interface_Tag_Components, Inherit_Components): Update occurrences
	of Related_Interface to Related_Type.
	(Record_Type_Declaration): Minor reordering of calls to decorate the
	Tag component because the entity must have set its Ekind attribute
	before setting its Is_Tag attribute.
	(Analyze_Subtype_Declaration): In the case of subtypes with
	Private_Kind, inherit Known_To_Have_Preelab_Init from the parent.

From-SVN: r130883
parent 2242f4dd
......@@ -120,18 +120,16 @@ package Sem_Ch3 is
-- subprogram of the parent type.
procedure Derive_Subprograms
(Parent_Type : Entity_Id;
Derived_Type : Entity_Id;
Generic_Actual : Entity_Id := Empty);
(Parent_Type : Entity_Id;
Derived_Type : Entity_Id;
Generic_Actual : Entity_Id := Empty);
-- To complete type derivation, collect/retrieve the primitive operations
-- of the parent type, and replace the subsidiary subtypes with the derived
-- type, to build the specs of the inherited ops. For generic actuals, the
-- mapping of the primitive operations to those of the parent type is also
-- done by rederiving the operations within the instance. For tagged types,
-- the derived subprograms are aliased to those of the actual, not those of
-- the ancestor. The last two params are used in case of derivation from
-- abstract interface types: No_Predefined_Prims is used to avoid the
-- derivation of predefined primitives from an abstract interface.
-- the ancestor.
--
-- Note: one might expect this to be private to the package body, but
-- there is one rather unusual usage in package Exp_Dist.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment