From ef9dd96c920268b679bfde704db2f72ffeef0f9b Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Wed, 30 Dec 2020 16:59:55 -0500 Subject: [PATCH] [Ada] Error message on invalid prefixed procedure call gcc/ada/ * sem_ch4.adb (Try_Object_Operation): When a prefixed call is overloaded and illegal, and the All_Errors flag is off, generate an error message if the re-analysis of some candidate interpretation fails to produce one. --- gcc/ada/sem_ch4.adb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 84ab221..77f2812 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -10215,6 +10215,16 @@ package body Sem_Ch4 is Report => True, Success => Success, Skip_First => True); + + -- The error may hot have been reported yet for overloaded + -- prefixed calls, depending on the non-matching candidate, + -- in which case provide a concise error now. + + if Serious_Errors_Detected = 0 then + Error_Msg_NE + ("cannot resolve prefixed call to primitive operation of&", + N, Entity (Prefix (N))); + end if; end if; -- No need for further errors -- 2.7.4