aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2008-05-28 17:56:02 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2008-05-28 17:56:02 +0200
commitc147ac264f3b123440f9c7b82f93f2adba3b0fda (patch)
tree667801847cbb4b49a92dd1a5d3b04e46137a2b6d /gcc
parent2b672e358d4022363e398446ff6efbf9b55e066e (diff)
downloadgcc-c147ac264f3b123440f9c7b82f93f2adba3b0fda.zip
gcc-c147ac264f3b123440f9c7b82f93f2adba3b0fda.tar.gz
gcc-c147ac264f3b123440f9c7b82f93f2adba3b0fda.tar.bz2
sem_res.adb (Valid_Conversion): An anonymous access_to_subprogram type has a deeper level than any master only...
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. From-SVN: r136113
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_res.adb16
1 files changed, 8 insertions, 8 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index d1f2cef..b6c72b4 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