aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.ads
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2023-04-03 17:11:11 +0200
committerMarc Poulhiès <poulhies@adacore.com>2023-05-29 10:23:19 +0200
commit1f0d389488382d51a2e0ef38c2761a074e9bd2d3 (patch)
treeaee50475662ba50de5861e57b53cdef240ac7dbe /gcc/ada/sem_ch4.ads
parent603c253d2698a586f5fa55acd25deb2bc8bd6e4f (diff)
downloadgcc-1f0d389488382d51a2e0ef38c2761a074e9bd2d3.zip
gcc-1f0d389488382d51a2e0ef38c2761a074e9bd2d3.tar.gz
gcc-1f0d389488382d51a2e0ef38c2761a074e9bd2d3.tar.bz2
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.
Diffstat (limited to 'gcc/ada/sem_ch4.ads')
-rw-r--r--gcc/ada/sem_ch4.ads3
1 files changed, 3 insertions, 0 deletions
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;