mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 05:10:25 +08:00
[multiple changes]
2009-06-24 Javier Miranda <miranda@adacore.com> * exp_ch4.adb (Expand_N_Type_Conversion): return immediately from processing the type conversion when the node is replaced by an N_Raise_Program_Error node. 2009-06-24 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Designates_From_With_Type): New routine. (Process_Formals): Since anonymous access types are no longer flagged as from with types, traverse the designated type to determine whether it is coming from a limited view. * sem_res.adb: Remove with and use clauses for Sem_Ch10. (Full_Designated_Type): Use Available_View to extract the non-limited / full view of a type. From-SVN: r148899
This commit is contained in:
parent
dd3e1ff529
commit
950d217a1c
@ -1,3 +1,20 @@
|
||||
2009-06-24 Javier Miranda <miranda@adacore.com>
|
||||
|
||||
* exp_ch4.adb (Expand_N_Type_Conversion): return immediately
|
||||
from processing the type conversion when the node is
|
||||
replaced by an N_Raise_Program_Error node.
|
||||
|
||||
2009-06-24 Hristian Kirtchev <kirtchev@adacore.com>
|
||||
|
||||
* sem_ch6.adb (Designates_From_With_Type): New routine.
|
||||
(Process_Formals): Since anonymous access types are no longer flagged
|
||||
as from with types, traverse the designated type to determine whether
|
||||
it is coming from a limited view.
|
||||
|
||||
* sem_res.adb: Remove with and use clauses for Sem_Ch10.
|
||||
(Full_Designated_Type): Use Available_View to extract the non-limited /
|
||||
full view of a type.
|
||||
|
||||
2009-06-24 Robert Dewar <dewar@adacore.com>
|
||||
|
||||
* exp_ch6.adb: Minor reformatting
|
||||
|
@ -7860,6 +7860,8 @@ package body Exp_Ch4 is
|
||||
Make_Raise_Program_Error (Sloc (N),
|
||||
Reason => PE_Accessibility_Check_Failed));
|
||||
Set_Etype (N, Target_Type);
|
||||
|
||||
return;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
|
@ -7837,11 +7837,36 @@ package body Sem_Ch6 is
|
||||
First_Out_Param : Entity_Id := Empty;
|
||||
-- Used for setting Is_Only_Out_Parameter
|
||||
|
||||
function Designates_From_With_Type (Typ : Entity_Id) return Boolean;
|
||||
-- Determine whether an access type designates a type coming from a
|
||||
-- limited view.
|
||||
|
||||
function Is_Class_Wide_Default (D : Node_Id) return Boolean;
|
||||
-- Check whether the default has a class-wide type. After analysis the
|
||||
-- default has the type of the formal, so we must also check explicitly
|
||||
-- for an access attribute.
|
||||
|
||||
-------------------------------
|
||||
-- Designates_From_With_Type --
|
||||
-------------------------------
|
||||
|
||||
function Designates_From_With_Type (Typ : Entity_Id) return Boolean is
|
||||
Desig : Entity_Id := Typ;
|
||||
|
||||
begin
|
||||
if Is_Access_Type (Desig) then
|
||||
Desig := Directly_Designated_Type (Desig);
|
||||
end if;
|
||||
|
||||
if Is_Class_Wide_Type (Desig) then
|
||||
Desig := Root_Type (Desig);
|
||||
end if;
|
||||
|
||||
return
|
||||
Ekind (Desig) = E_Incomplete_Type
|
||||
and then From_With_Type (Desig);
|
||||
end Designates_From_With_Type;
|
||||
|
||||
---------------------------
|
||||
-- Is_Class_Wide_Default --
|
||||
---------------------------
|
||||
@ -8031,7 +8056,7 @@ package body Sem_Ch6 is
|
||||
-- is also class-wide.
|
||||
|
||||
if Ekind (Formal_Type) = E_Anonymous_Access_Type
|
||||
and then not From_With_Type (Formal_Type)
|
||||
and then not Designates_From_With_Type (Formal_Type)
|
||||
and then Is_Class_Wide_Default (Default)
|
||||
and then not Is_Class_Wide_Type (Designated_Type (Formal_Type))
|
||||
then
|
||||
|
@ -9620,26 +9620,19 @@ package body Sem_Res is
|
||||
--------------------------
|
||||
|
||||
function Full_Designated_Type (T : Entity_Id) return Entity_Id is
|
||||
Desig : Entity_Id := Designated_Type (T);
|
||||
Desig : constant Entity_Id := Designated_Type (T);
|
||||
|
||||
begin
|
||||
-- Handle the limited view of a type
|
||||
|
||||
if Is_Incomplete_Type (Desig)
|
||||
and then From_With_Type (Desig)
|
||||
and then Present (Non_Limited_View (Desig))
|
||||
then
|
||||
Desig := Non_Limited_View (Desig);
|
||||
|
||||
-- The shadow entity's non-limited view may designate an
|
||||
-- incomplete type.
|
||||
|
||||
if Is_Incomplete_Type (Desig)
|
||||
and then Present (Full_View (Desig))
|
||||
then
|
||||
Desig := Full_View (Desig);
|
||||
end if;
|
||||
return Available_View (Desig);
|
||||
else
|
||||
return Desig;
|
||||
end if;
|
||||
|
||||
return Desig;
|
||||
end Full_Designated_Type;
|
||||
|
||||
-- Local Declarations
|
||||
|
Loading…
x
Reference in New Issue
Block a user