Commit a73734f5 by Arnaud Charlet

[multiple changes]

2009-07-29  Robert Dewar  <dewar@adacore.com>

	* exp_atag.ads, exp_atag.adb, s-tasini.adb, s-soflin.ads,
	exp_disp.adb, g-socket.adb: Minor reformatting

2009-07-29  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch7.adb (New_Private_Type): Create class-wide type after other
	attributes have been established, so that they are all inherited by the
	class-wide type.
	* sem_cat.adb (Validate_Remote_Access_Object_Type_Declaration): Handle
	properly named subtypes of class-wide types.

From-SVN: r150201
parent 53b10ce9
2009-07-29 Robert Dewar <dewar@adacore.com>
* exp_atag.ads, exp_atag.adb, s-tasini.adb, s-soflin.ads,
exp_disp.adb, g-socket.adb: Minor reformatting
2009-07-29 Ed Schonberg <schonberg@adacore.com>
* sem_ch7.adb (New_Private_Type): Create class-wide type after other
attributes have been established, so that they are all inherited by the
class-wide type.
* sem_cat.adb (Validate_Remote_Access_Object_Type_Declaration): Handle
properly named subtypes of class-wide types.
2009-07-29 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Check_Overriding_Indicator): Handle properly overriding
......
......@@ -815,7 +815,7 @@ package body Exp_Disp is
Selector_Name => New_Reference_To (DTC_Entity (Subp), Loc));
end if;
-- Handle dispatching calls to predefined primitives.
-- Handle dispatching calls to predefined primitives
if Is_Predefined_Dispatching_Operation (Subp)
or else Is_Predefined_Dispatching_Alias (Subp)
......@@ -854,10 +854,10 @@ package body Exp_Disp is
-- Handle renaming of selected component
elsif Nkind (Controlling_Tag) = N_Identifier
and then Nkind (Parent (Entity (Controlling_Tag)))
= N_Object_Renaming_Declaration
and then Nkind (Name (Parent (Entity (Controlling_Tag))))
= N_Selected_Component
and then Nkind (Parent (Entity (Controlling_Tag))) =
N_Object_Renaming_Declaration
and then Nkind (Name (Parent (Entity (Controlling_Tag)))) =
N_Selected_Component
then
Set_SCIL_Controlling_Tag (SCIL_Node,
Name (Parent (Entity (Controlling_Tag))));
......@@ -938,8 +938,8 @@ package body Exp_Disp is
Unchecked_Convert_To (Typ,
New_Value (Next_Actual (Param))),
Selector_Name =>
New_Reference_To (First_Tag_Component (Typ),
Loc))),
New_Reference_To
(First_Tag_Component (Typ), Loc))),
Right_Opnd => New_Call);
end if;
......
......@@ -1664,11 +1664,14 @@ package body GNAT.Sockets is
(Msg_Name => System.Null_Address,
Msg_Namelen => 0,
Msg_Iov => Vector'Address,
Msg_Iovlen =>
SOSC.Msg_Iovlen_T'Min (Vector'Length, SOSC.IOV_MAX),
-- recvmsg(2) returns EMSGSIZE on Linux (and probably on other
-- platforms) when the supplied vector is longer than IOV_MAX,
-- so use minimum of the two lengths.
Msg_Iovlen => SOSC.Msg_Iovlen_T'Min
(Vector'Length, SOSC.IOV_MAX),
Msg_Control => System.Null_Address,
Msg_Controllen => 0,
Msg_Flags => 0);
......
......@@ -191,8 +191,8 @@ package body System.Tasking.Initialization is
end if;
-- pragma Assert
-- ((Self_ID.Pending_ATC_Level >= Self_ID.ATC_Nesting_Level or else
-- Self_ID.Deferral_Level > 0));
-- (Self_ID.Pending_ATC_Level >= Self_ID.ATC_Nesting_Level or else
-- Self_ID.Deferral_Level > 0);
-- See comment in Defer_Abort on the situations in which it may be
-- useful to uncomment the above assertion.
......
......@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
......@@ -1774,12 +1774,12 @@ package body Sem_Cat is
-- Check RCI or RT unit type declaration. It may not contain the
-- declaration of an access-to-object type unless it is a general access
-- type that designates a class-wide limited private type. There are
-- also constraints on the primitive subprograms of the class-wide type
-- (RM E.2.2(14), see Validate_RACW_Primitives).
-- type that designates a class-wide limited private type or subtype.
-- There are also constraints on the primitive subprograms of the
-- class-wide type (RM E.2.2(14), see Validate_RACW_Primitives).
if Ekind (T) /= E_General_Access_Type
or else Ekind (Designated_Type (T)) /= E_Class_Wide_Type
or else not Is_Class_Wide_Type (Designated_Type (T))
then
if In_RCI_Declaration (Parent (T)) then
Error_Msg_N
......
......@@ -1907,12 +1907,15 @@ package body Sem_Ch7 is
if Tagged_Present (Def) then
Set_Ekind (Id, E_Record_Type_With_Private);
Make_Class_Wide_Type (Id);
Set_Primitive_Operations (Id, New_Elmt_List);
Set_Is_Abstract_Type (Id, Abstract_Present (Def));
Set_Is_Limited_Record (Id, Limited_Present (Def));
Set_Has_Delayed_Freeze (Id, True);
-- Create a class-wide type with the same attributes.
Make_Class_Wide_Type (Id);
elsif Abstract_Present (Def) then
Error_Msg_N ("only a tagged type can be abstract", N);
end if;
......
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