From 0f5abd21483aeddbaa3dcd475ac0c686d835772e Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Thu, 12 Dec 2019 10:03:35 +0000 Subject: [PATCH] [Ada] Improve error message for dispatching subprogram formals 2019-12-12 Ed Schonberg gcc/ada/ * sem_ch8.adb: Improve error message for dispatching subprogram formals. From-SVN: r279301 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/sem_ch8.adb | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 386ae097679..d859109a030 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2019-12-12 Ed Schonberg + + * sem_ch8.adb: Improve error message for dispatching subprogram + formals. + 2019-12-12 Gary Dismukes * exp_ch9.adb (Build_Protected_Entry): Set the Scope of the new diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 38cbf1cd26b..8897b25e046 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -3453,9 +3453,14 @@ package body Sem_Ch8 is if Old_S_Ctrl_Type /= New_S_Ctrl_Type or else No (New_S_Ctrl_Type) then - Error_Msg_NE - ("actual must be dispatching subprogram for type&", - Nam, New_S_Ctrl_Type); + if No (New_S_Ctrl_Type) then + Error_Msg_N + ("actual must be dispatching subprogram", Nam); + else + Error_Msg_NE + ("actual must be dispatching subprogram for type&", + Nam, New_S_Ctrl_Type); + end if; else Set_Is_Dispatching_Operation (New_S); -- 2.30.2