diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-14 14:35:51 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2013-10-14 14:35:51 +0200 |
commit | d1d81616ecc0fe14487a862ad25b64a83da6173b (patch) | |
tree | b0d13bbdbbe63efe8b881da9304449259c6a75ec | |
parent | 54e28df21a7c44d4643353a1a3c9b042eabdfc20 (diff) | |
download | gcc-d1d81616ecc0fe14487a862ad25b64a83da6173b.zip gcc-d1d81616ecc0fe14487a862ad25b64a83da6173b.tar.gz gcc-d1d81616ecc0fe14487a862ad25b64a83da6173b.tar.bz2 |
[multiple changes]
2013-10-14 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Global_Item): Allow
references to enclosing formal parameters.
2013-10-14 Thomas Quinot <quinot@adacore.com>
* einfo.adb (Equivalent_Type): Add missing case
E_Access_Subprogram_Type in guard (for remote access to
subprograms) * sem_ch8.adb (Find_Direct_Name, Find_Expanded_Name):
Add missing guards to account for the presence of RAS types
that have already been replaced with the corresponding fat
pointer type.
From-SVN: r203523
-rw-r--r-- | gcc/ada/ChangeLog | 14 | ||||
-rw-r--r-- | gcc/ada/einfo.adb | 1 | ||||
-rw-r--r-- | gcc/ada/sem_ch8.adb | 2 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 13 |
4 files changed, 25 insertions, 5 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f9c6ace..1c86e5c 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,19 @@ 2013-10-14 Hristian Kirtchev <kirtchev@adacore.com> + * sem_prag.adb (Analyze_Global_Item): Allow + references to enclosing formal parameters. + +2013-10-14 Thomas Quinot <quinot@adacore.com> + + * einfo.adb (Equivalent_Type): Add missing case + E_Access_Subprogram_Type in guard (for remote access to + subprograms) * sem_ch8.adb (Find_Direct_Name, Find_Expanded_Name): + Add missing guards to account for the presence of RAS types + that have already been replaced with the corresponding fat + pointer type. + +2013-10-14 Hristian Kirtchev <kirtchev@adacore.com> + * aspects.adb: Add an entry in table Canonical_Aspect for Initializes. * aspects.ads: Add entries in tables Aspect_Id, Aspect_Argument, diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 2c1a094..10b4aac 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -1112,6 +1112,7 @@ package body Einfo is pragma Assert (Ekind_In (Id, E_Class_Wide_Type, E_Class_Wide_Subtype, + E_Access_Subprogram_Type, E_Access_Protected_Subprogram_Type, E_Anonymous_Access_Protected_Subprogram_Type, E_Access_Subprogram_Type, diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index ee2749f..c970192 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -4987,6 +4987,7 @@ package body Sem_Ch8 is if Comes_From_Source (N) and then Is_Remote_Access_To_Subprogram_Type (E) + and then Ekind (E) = E_Access_Subprogram_Type and then Expander_Active and then Get_PCS_Name /= Name_No_DSA then @@ -5488,6 +5489,7 @@ package body Sem_Ch8 is <<Found>> if Comes_From_Source (N) and then Is_Remote_Access_To_Subprogram_Type (Id) + and then Ekind (Id) = E_Access_Subprogram_Type and then Present (Equivalent_Type (Id)) then -- If we are not actually generating distribution code (i.e. the diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 070d7cb..09c0473 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -1428,13 +1428,16 @@ package body Sem_Prag is if Present (Item_Id) then - -- A global item cannot reference a formal parameter. Do this - -- check first to provide a better error diagnostic. + -- A global item may denote a formal parameter of an enclosing + -- subprogram. Do this check first to provide a better error + -- diagnostic. if Is_Formal (Item_Id) then - Error_Msg_N - ("global item cannot reference formal parameter", Item); - return; + if Scope (Item_Id) = Subp_Id then + Error_Msg_N + ("global item cannot reference formal parameter", Item); + return; + end if; -- The only legal references are those to abstract states and -- variables. |