From: Ed Schonberg Date: Thu, 12 Dec 2019 10:03:35 +0000 (+0000) Subject: [Ada] Improve error message for dispatching subprogram formals X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f5abd21483aeddbaa3dcd475ac0c686d835772e;p=gcc.git [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 --- 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);