From 1f0d389488382d51a2e0ef38c2761a074e9bd2d3 Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Mon, 3 Apr 2023 17:11:11 +0200 Subject: ada: Repair support for user-defined literals in arithmetic operators It was partially broken to fix a regression in error reporting, because the fix was applied to the first pass of resolution instead of the second pass, as needs to be done for user-defined literals. gcc/ada/ * sem_ch4.ads (Unresolved_Operator): New procedure. * sem_ch4.adb (Has_Possible_Literal_Aspects): Rename into... (Has_Possible_User_Defined_Literal): ...this. Tidy up. (Operator_Check): Accept again unresolved operators if they have a possible user-defined literal as operand. Factor out the handling of the general error message into... (Unresolved_Operator): ...this new procedure. * sem_res.adb (Resolve): Be prepared for unresolved operators on entry in Ada 2022 or later. If they are still unresolved on exit, call Unresolved_Operator to give the error message. (Try_User_Defined_Literal): Tidy up. --- gcc/ada/sem_ch4.ads | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/ada/sem_ch4.ads') diff --git a/gcc/ada/sem_ch4.ads b/gcc/ada/sem_ch4.ads index a0e2069..6f266a7 100644 --- a/gcc/ada/sem_ch4.ads +++ b/gcc/ada/sem_ch4.ads @@ -88,4 +88,7 @@ package Sem_Ch4 is -- of a non-tagged type is allowed as if Extensions_Allowed returned True. -- This is used to issue better error messages. + procedure Unresolved_Operator (N : Node_Id); + -- Give an error for an unresolved operator + end Sem_Ch4; -- cgit v1.1