diff options
author | Hristian Kirtchev <kirtchev@adacore.com> | 2009-06-23 10:15:47 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2009-06-23 12:15:47 +0200 |
commit | c0985d4ed8bc79ad6cafed12f7fa3089d13879ae (patch) | |
tree | c2323c664483500ace95513d11d3ccfe251a282a /gcc/ada/sem_res.adb | |
parent | 0d354370f2e1b51efcf45c9241cabd0c7873b977 (diff) | |
download | gcc-c0985d4ed8bc79ad6cafed12f7fa3089d13879ae.zip gcc-c0985d4ed8bc79ad6cafed12f7fa3089d13879ae.tar.gz gcc-c0985d4ed8bc79ad6cafed12f7fa3089d13879ae.tar.bz2 |
sem_attr.adb: Add with and use clauses for Sem_Ch10.
2009-06-23 Hristian Kirtchev <kirtchev@adacore.com>
* sem_attr.adb: Add with and use clauses for Sem_Ch10.
(Check_Not_Incomplete_Type): Minor reformatting. Retrieve the root type
when dealing with class-wide types. Detect a legal shadow entity and
retrieve its non-limited view.
* sem_ch10.adb (Has_With_Clause): Move the spec and body of the
subprogram to top package level from Intall_Limited_Withed_Unit.
(Install_Limited_Withed_Unit): Remove spec and body of Has_With_Clause.
Add check which prevents the installation of a limited view if the
non-limited view is already visible through a with clause.
(Is_Legal_Shadow_Entity_In_Body): New routine. Detect a residual, but
legal shadow entity which may occur in subprogram formals of anonymous
access type.
* sem_ch10.ads (Is_Legal_Shadow_Entity_In_Body): New routine.
* sem_ch3.adb (Access_Definition): Remove the propagation of flag
From_With_Type from the designated type to the generated anonymous
access type. Remove associated comment.
* sem_res.adb Add with and use clauses for Sem_Ch10.
(Full_Designated_Type): Detect a legal shadow entity and retrieve its
non-limited view. Since the shadow entity may replace a regular
incomplete type, return the available full view.
From-SVN: r148844
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index e1a934b..e2c6103 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -57,6 +57,7 @@ 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; @@ -9619,16 +9620,20 @@ package body Sem_Res is -------------------------- function Full_Designated_Type (T : Entity_Id) return Entity_Id is - Desig : constant Entity_Id := Designated_Type (T); + Desig : Entity_Id := Designated_Type (T); + begin - if From_With_Type (Desig) - and then Is_Incomplete_Type (Desig) + -- 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 - return Non_Limited_View (Desig); - else - return Desig; + Desig := Non_Limited_View (Desig); end if; + + return Available_View (Desig); end Full_Designated_Type; -- Local Declarations |