]> gcc.gnu.org Git - gcc.git/commitdiff
[Ada] Error message on invalid prefixed procedure call
authorEd Schonberg <schonberg@adacore.com>
Wed, 30 Dec 2020 21:59:55 +0000 (16:59 -0500)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 3 May 2021 09:28:25 +0000 (05:28 -0400)
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

index 84ab221ba48b6a1eed24997fb3c1c7f115bea9d6..77f2812ba38e20c4a81694fb2d85c9f79fefa323 100644 (file)
@@ -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
This page took 0.077479 seconds and 5 git commands to generate.