summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-23 10:27:31 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-23 10:27:31 +0000
commit749c967d6eb1d6a059f73179adee60e9ed89a4de (patch)
treef0311b1e502afa7ff259258722c48b933768c5bf /gcc/ada/sem_res.adb
parent20167aff51290cf332504a1f9c7573d5f31c75b0 (diff)
downloadgcc-749c967d6eb1d6a059f73179adee60e9ed89a4de.tar.gz
2009-06-23 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Valid_Conversion, Full_Designated_Type): Use Available_View only when designated type of an anonymous access type is limited view. 2009-06-23 Robert Dewar <dewar@adacore.com> * sem_ch10.adb: Minor reformatting * gnat1drv.adb (Adjust_Global_Switches): New procedure (take care of turning off inlining if ASIS mode active). * switch-c.adb: Remove fiddling with Inspector_Mode and ASIS_Mode This belongs in gnat1drv.adb after switches are scanned. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148846 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb24
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index e2c6103b1aa..a662d5bf46a 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -57,7 +57,6 @@ with Sem_Cat; use Sem_Cat;
with Sem_Ch4; use Sem_Ch4;
with Sem_Ch6; use Sem_Ch6;
with Sem_Ch8; use Sem_Ch8;
-with Sem_Ch10; use Sem_Ch10;
with Sem_Ch13; use Sem_Ch13;
with Sem_Disp; use Sem_Disp;
with Sem_Dist; use Sem_Dist;
@@ -9609,9 +9608,10 @@ package body Sem_Res is
end if;
end if;
- -- Need some comments here, and a name for this block ???
+ -- In the presence of limited_with clauses we have to use non-limited
+ -- views, if available.
- declare
+ Check_Limited : declare
function Full_Designated_Type (T : Entity_Id) return Entity_Id;
-- Helper function to handle limited views
@@ -9623,17 +9623,23 @@ package body Sem_Res is
Desig : Entity_Id := Designated_Type (T);
begin
- -- Detect a legal use of a shadow entity
-
if Is_Incomplete_Type (Desig)
and then From_With_Type (Desig)
and then Present (Non_Limited_View (Desig))
- and then Is_Legal_Shadow_Entity_In_Body (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;
end if;
- return Available_View (Desig);
+ return Desig;
end Full_Designated_Type;
-- Local Declarations
@@ -9644,7 +9650,7 @@ package body Sem_Res is
Same_Base : constant Boolean :=
Base_Type (Target) = Base_Type (Opnd);
- -- Start of processing for ???
+ -- Start of processing for Check_Limited
begin
if Is_Tagged_Type (Target) then
@@ -9698,7 +9704,7 @@ package body Sem_Res is
return False;
end if;
end if;
- end;
+ end Check_Limited;
-- Access to subprogram types. If the operand is an access parameter,
-- the type has a deeper accessibility that any master, and cannot