diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-28 15:56:02 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-28 15:56:02 +0000 |
commit | 3ad85fa21e744ab071be64d1276e1834725c586b (patch) | |
tree | 667801847cbb4b49a92dd1a5d3b04e46137a2b6d /gcc/ada/sem_res.adb | |
parent | 73dc8e415ac8fabea2c9b19f3b3f50117d49fd39 (diff) | |
download | gcc-3ad85fa21e744ab071be64d1276e1834725c586b.tar.gz |
2008-05-28 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Valid_Conversion): An anonymous access_to_subprogram
type has a deeper level than any master only when it is the type of an
access parameter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136113 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r-- | gcc/ada/sem_res.adb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index d1f2cefc803..b6c72b44cde 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -9434,7 +9434,9 @@ package body Sem_Res is end if; end; - -- Subprogram access types + -- access to subprogram types. If the operand is an access parameter, + -- the type has a deeper accessibility that any master, and cannot + -- be assigned. elsif (Ekind (Target_Type) = E_Access_Subprogram_Type or else @@ -9443,6 +9445,8 @@ package body Sem_Res is then if Ekind (Base_Type (Opnd_Type)) = E_Anonymous_Access_Subprogram_Type + and then Is_Entity_Name (Operand) + and then Ekind (Entity (Operand)) = E_In_Parameter then Error_Msg_N ("illegal attempt to store anonymous access to subprogram", @@ -9452,13 +9456,9 @@ package body Sem_Res is "(RM 3.10.2 (13))", Operand); - if Is_Entity_Name (Operand) - and then Ekind (Entity (Operand)) = E_In_Parameter - then - Error_Msg_NE - ("\use named access type for& instead of access parameter", - Operand, Entity (Operand)); - end if; + Error_Msg_NE + ("\use named access type for& instead of access parameter", + Operand, Entity (Operand)); end if; -- Check that the designated types are subtype conformant |