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
This commit is contained in:
parent
2b672e358d
commit
c147ac264f
|
@ -9434,7 +9434,9 @@ package body Sem_Res is
|
||||||
end if;
|
end if;
|
||||||
end;
|
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
|
elsif (Ekind (Target_Type) = E_Access_Subprogram_Type
|
||||||
or else
|
or else
|
||||||
|
@ -9443,6 +9445,8 @@ package body Sem_Res is
|
||||||
then
|
then
|
||||||
if
|
if
|
||||||
Ekind (Base_Type (Opnd_Type)) = E_Anonymous_Access_Subprogram_Type
|
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
|
then
|
||||||
Error_Msg_N
|
Error_Msg_N
|
||||||
("illegal attempt to store anonymous access to subprogram",
|
("illegal attempt to store anonymous access to subprogram",
|
||||||
|
@ -9452,13 +9456,9 @@ package body Sem_Res is
|
||||||
"(RM 3.10.2 (13))",
|
"(RM 3.10.2 (13))",
|
||||||
Operand);
|
Operand);
|
||||||
|
|
||||||
if Is_Entity_Name (Operand)
|
Error_Msg_NE
|
||||||
and then Ekind (Entity (Operand)) = E_In_Parameter
|
("\use named access type for& instead of access parameter",
|
||||||
then
|
Operand, Entity (Operand));
|
||||||
Error_Msg_NE
|
|
||||||
("\use named access type for& instead of access parameter",
|
|
||||||
Operand, Entity (Operand));
|
|
||||||
end if;
|
|
||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- Check that the designated types are subtype conformant
|
-- Check that the designated types are subtype conformant
|
||||||
|
|
Loading…
Reference in New Issue