aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2006-02-15 10:40:24 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2006-02-15 10:40:24 +0100
commitadd9f797fa0cc76741c777eaf3839072234a6ede (patch)
treef0db4c59a951036451ca31e04f52c0c13bff0d71
parent59e54267fc4d2eec894f1f4f4f8fc596cee68f3a (diff)
downloadgcc-add9f797fa0cc76741c777eaf3839072234a6ede.zip
gcc-add9f797fa0cc76741c777eaf3839072234a6ede.tar.gz
gcc-add9f797fa0cc76741c777eaf3839072234a6ede.tar.bz2
freeze.adb (Freeze_Entity): Handle subtypes of protected types and task types when...
2006-02-13 Javier Miranda <miranda@adacore.com> * freeze.adb (Freeze_Entity): Handle subtypes of protected types and task types when accessing to the corresponding record type. Remove '!' in warning message. From-SVN: r111070
-rw-r--r--gcc/ada/freeze.adb27
1 files changed, 19 insertions, 8 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 1a12c4f..09363af 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2006, 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- --
@@ -2227,7 +2227,7 @@ package body Freeze is
if Formal = First_Formal (E) then
Error_Msg_NE
- ("?in inherited operation&!", Warn_Node, E);
+ ("?in inherited operation&", Warn_Node, E);
end if;
else
Warn_Node := Formal;
@@ -2372,7 +2372,7 @@ package body Freeze is
-- pragma is to suppress implicit initialization.
if Is_Imported (E)
- and then not Present (Address_Clause (E))
+ and then No (Address_Clause (E))
then
Set_Is_Public (E);
end if;
@@ -3159,8 +3159,19 @@ package body Freeze is
Prim_List : Elist_Id;
Prim : Elmt_Id;
Ent : Entity_Id;
+ Aux_E : Entity_Id;
begin
+ -- Handle subtypes
+
+ if Ekind (E) = E_Protected_Subtype
+ or else Ekind (E) = E_Task_Subtype
+ then
+ Aux_E := Etype (E);
+ else
+ Aux_E := E;
+ end if;
+
-- Ada 2005 (AI-345): In case of concurrent type generate
-- reference to the wrapper that allow us to dispatch calls
-- through their implemented abstract interface types.
@@ -3168,17 +3179,17 @@ package body Freeze is
-- The check for Present here is to protect against previously
-- reported critical errors.
- if Is_Concurrent_Type (E)
- and then Present (Corresponding_Record_Type (E))
+ if Is_Concurrent_Type (Aux_E)
+ and then Present (Corresponding_Record_Type (Aux_E))
then
pragma Assert (not Is_Empty_Elmt_List
(Abstract_Interfaces
- (Corresponding_Record_Type (E))));
+ (Corresponding_Record_Type (Aux_E))));
Prim_List := Primitive_Operations
- (Corresponding_Record_Type (E));
+ (Corresponding_Record_Type (Aux_E));
else
- Prim_List := Primitive_Operations (E);
+ Prim_List := Primitive_Operations (Aux_E);
end if;
-- Loop to generate references for primitive operations