aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2025-01-05 23:21:31 +0100
committerMarc Poulhiès <dkm@gcc.gnu.org>2025-01-09 13:56:38 +0100
commitf622acc1eb2679f14758a1ad6c5b693cd9bdea23 (patch)
treee9a7f7e553f9686f5cbeda983a75b072967eaf2d /gcc/ada
parentd107140205537aec9c8e235d869b166e9b884775 (diff)
downloadgcc-f622acc1eb2679f14758a1ad6c5b693cd9bdea23.zip
gcc-f622acc1eb2679f14758a1ad6c5b693cd9bdea23.tar.gz
gcc-f622acc1eb2679f14758a1ad6c5b693cd9bdea23.tar.bz2
ada: Accept predefined multiply operator for fixed point in expression function
The RM 4.5.5(19.1/2) subclause says that the predefined multiply operator for universal_fixed is still available, despite the declaration of a user- defined primitive multiply operator for the fixed-point type at stake, if it is identified using an expanded name with prefix denoting Standard, but this is currently not the case in the context of an expression function. gcc/ada/ChangeLog: PR ada/118274 * sem_ch4.adb (Check_Arithmetic_Pair.Has_Fixed_Op): Use the original node of the operator to identify the case of an expanded name whose prefix is the package Standard.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_ch4.adb12
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 5b9456b..4069839 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -6619,18 +6619,20 @@ package body Sem_Ch4 is
------------------
function Has_Fixed_Op (Typ : Entity_Id; Op : Entity_Id) return Boolean is
- Bas : constant Entity_Id := Base_Type (Typ);
+ Bas : constant Entity_Id := Base_Type (Typ);
+ Orig_N : constant Node_Id := Original_Node (N);
+
Ent : Entity_Id;
F1 : Entity_Id;
F2 : Entity_Id;
begin
- -- If the universal_fixed operation is given explicitly the rule
+ -- If the universal_fixed operation is given explicitly, the rule
-- concerning primitive operations of the type do not apply.
- if Nkind (N) = N_Function_Call
- and then Nkind (Name (N)) = N_Expanded_Name
- and then Entity (Prefix (Name (N))) = Standard_Standard
+ if Nkind (Orig_N) = N_Function_Call
+ and then Nkind (Name (Orig_N)) = N_Expanded_Name
+ and then Entity (Prefix (Name (Orig_N))) = Standard_Standard
then
return False;
end if;