summaryrefslogtreecommitdiff
path: root/gcc/ada/errout.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/errout.adb')
-rw-r--r--gcc/ada/errout.adb24
1 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index aa36a9ddaab..651b43d1122 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -2848,13 +2848,35 @@ package body Errout is
Buffer_Remove ("type ");
end if;
- Set_Msg_Str ("access to subprogram with profile ");
+ if Is_Itype (Ent) then
+ declare
+ Assoc : constant Node_Id :=
+ Associated_Node_For_Itype (Ent);
+
+ begin
+ if Nkind (Assoc) in N_Subprogram_Specification then
+
+ -- Anonymous access to subprogram in a signature.
+ -- Indicate the enclosing subprogram.
+
+ Ent :=
+ Defining_Unit_Name
+ (Associated_Node_For_Itype (Ent));
+ Set_Msg_Str
+ ("access to subprogram declared in profile of ");
+
+ else
+ Set_Msg_Str ("access to subprogram with profile ");
+ end if;
+ end;
+ end if;
elsif Ekind (Ent) = E_Function then
Set_Msg_Str ("access to function ");
else
Set_Msg_Str ("access to procedure ");
end if;
+
exit;
-- Type is access to object, named or anonymous