]> gcc.gnu.org Git - gcc.git/commit - gcc/ada/sem_res.adb
ada: Repair support for user-defined literals in arithmetic operators
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 3 Apr 2023 15:11:11 +0000 (17:11 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 29 May 2023 08:23:19 +0000 (10:23 +0200)
commit1f0d389488382d51a2e0ef38c2761a074e9bd2d3
treeaee50475662ba50de5861e57b53cdef240ac7dbe
parent603c253d2698a586f5fa55acd25deb2bc8bd6e4f
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.adb
gcc/ada/sem_ch4.ads
gcc/ada/sem_res.adb
This page took 0.058521 seconds and 5 git commands to generate.