aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2019-12-12 10:03:35 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-12-12 10:03:35 +0000
commit0f5abd21483aeddbaa3dcd475ac0c686d835772e (patch)
treef2cd63c8abf6744d620da1aa9b66b8a2de7dc066
parentca00cd02323d71e99cebf583c34b07e7fc56c716 (diff)
downloadgcc-0f5abd21483aeddbaa3dcd475ac0c686d835772e.zip
gcc-0f5abd21483aeddbaa3dcd475ac0c686d835772e.tar.gz
gcc-0f5abd21483aeddbaa3dcd475ac0c686d835772e.tar.bz2
[Ada] Improve error message for dispatching subprogram formals
2019-12-12 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * sem_ch8.adb: Improve error message for dispatching subprogram formals. From-SVN: r279301
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_ch8.adb11
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 386ae09..d859109 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-12-12 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch8.adb: Improve error message for dispatching subprogram
+ formals.
+
2019-12-12 Gary Dismukes <dismukes@adacore.com>
* 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 38cbf1c..8897b25 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);