Commit 7f1a5156 by Eric Botcazou Committed by Arnaud Charlet

einfo.ads (Has_Private_Ancestor): Remove obsolete usage.

2014-08-01  Eric Botcazou  <ebotcazou@adacore.com>

	* einfo.ads (Has_Private_Ancestor): Remove obsolete usage.
	* exp_ch4.adb (Expand_Composite_Equality): Add conversion
	of the actuals in the case of untagged record types too.
	* sem_ch3.adb (Build_Full_Derivation): New procedure to create the
	full derivation of a derived private type, extracted from...
	(Copy_And_Build): In the case of record types and most
	enumeration types, copy the original declaration.  Build the
	full derivation according to the approach extracted from...
	(Build_Derived_Private_Type): ...here.	Call Build_Full_Derivation
	to create the full derivation in all existing cases and also
	create it in the no-discriminants/discriminants case instead of
	deriving directly from the full view.
	(Is_Visible_Component): Remove obsolete code.
	* sem_aggr.adb (Resolve_Record_Aggregate): Likewise.

From-SVN: r213476
parent b5119ab1
2014-08-01 Eric Botcazou <ebotcazou@adacore.com>
* einfo.ads (Has_Private_Ancestor): Remove obsolete usage.
* exp_ch4.adb (Expand_Composite_Equality): Add conversion
of the actuals in the case of untagged record types too.
* sem_ch3.adb (Build_Full_Derivation): New procedure to create the
full derivation of a derived private type, extracted from...
(Copy_And_Build): In the case of record types and most
enumeration types, copy the original declaration. Build the
full derivation according to the approach extracted from...
(Build_Derived_Private_Type): ...here. Call Build_Full_Derivation
to create the full derivation in all existing cases and also
create it in the no-discriminants/discriminants case instead of
deriving directly from the full view.
(Is_Visible_Component): Remove obsolete code.
* sem_aggr.adb (Resolve_Record_Aggregate): Likewise.
2014-08-01 Arnaud Charlet <charlet@adacore.com> 2014-08-01 Arnaud Charlet <charlet@adacore.com>
* fe.h (GNAT_Mode): New. * fe.h (GNAT_Mode): New.
......
...@@ -1799,14 +1799,12 @@ package Einfo is ...@@ -1799,14 +1799,12 @@ package Einfo is
-- is defined for the type. -- is defined for the type.
-- Has_Private_Ancestor (Flag151) -- Has_Private_Ancestor (Flag151)
-- Applies to untagged derived types and to type extensions. True when -- Applies to type extensions. True if some ancestor is derived from a
-- some ancestor is derived from a private type, making some components -- private type, making some components invisible and aggregates illegal.
-- invisible and aggregates illegal. Used to check the legality of -- This flag is set at the point of derivation. The legality of the
-- selected components and aggregates. The flag is set at the point of -- aggregate must be rechecked because it also depends on the visibility
-- derivation. The legality of an aggregate of a type with a private -- at the point the aggregate is resolved. See sem_aggr.adb.
-- ancestor must be checked because it also depends on the visibility -- This is part of AI05-0115.
-- at the point the aggregate is resolved. See sem_aggr.adb. This is
-- part of AI05-0115.
-- Has_Private_Declaration (Flag155) -- Has_Private_Declaration (Flag155)
-- Defined in all entities. Set if it is the defining entity of a private -- Defined in all entities. Set if it is the defining entity of a private
......
...@@ -2829,10 +2829,17 @@ package body Exp_Ch4 is ...@@ -2829,10 +2829,17 @@ package body Exp_Ch4 is
end; end;
else else
return declare
Make_Function_Call (Loc, T : constant Entity_Id := Etype (First_Formal (Eq_Op));
Name => New_Occurrence_Of (Eq_Op, Loc),
Parameter_Associations => New_List (Lhs, Rhs)); begin
return
Make_Function_Call (Loc,
Name => New_Occurrence_Of (Eq_Op, Loc),
Parameter_Associations => New_List (
OK_Convert_To (T, Lhs),
OK_Convert_To (T, Rhs)));
end;
end if; end if;
end if; end if;
......
...@@ -3984,21 +3984,6 @@ package body Sem_Aggr is ...@@ -3984,21 +3984,6 @@ package body Sem_Aggr is
-- Typ is not a derived tagged type -- Typ is not a derived tagged type
else else
-- A type derived from an untagged private type whose full view
-- has discriminants is constructed as a record type but there
-- are no legal aggregates for it.
if Is_Derived_Type (Typ)
and then Has_Private_Ancestor (Typ)
and then Nkind (N) /= N_Extension_Aggregate
then
Error_Msg_Node_2 := Base_Type (Etype (Typ));
Error_Msg_NE
("no aggregate available for type& derived from "
& "private type&", N, Typ);
return;
end if;
Record_Def := Type_Definition (Parent (Base_Type (Typ))); Record_Def := Type_Definition (Parent (Base_Type (Typ)));
if Null_Present (Record_Def) then if Null_Present (Record_Def) then
......
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