aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@adacore.com>2020-04-07 11:05:59 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-16 09:07:15 -0400
commitd51bf619f723292fd1475deb58b7b14144495648 (patch)
tree379b3136c732eac2b97401a2e7789b4d3084adb8 /gcc/ada/exp_ch4.adb
parent3c9a82fec0e08b24ee49c94c3cdfd6c426042f64 (diff)
downloadgcc-d51bf619f723292fd1475deb58b7b14144495648.zip
gcc-d51bf619f723292fd1475deb58b7b14144495648.tar.gz
gcc-d51bf619f723292fd1475deb58b7b14144495648.tar.bz2
[Ada] ACATS C452005/C452006 memberships use wrong equality operation
2020-06-16 Arnaud Charlet <charlet@adacore.com> gcc/ada/ * sem_aux.ads, sem_aux.adb (Is_Record_Or_Limited_Type): New function. * exp_ch4.adb, sem_ch4.adb (Analyze_Membership_Op, Expand_Set_Membership.Make_Cond): Choose between primitive and predefined equality for membership tests.
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index f5ad90a..3d706bf 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -12717,10 +12717,13 @@ package body Exp_Ch4 is
Left_Opnd => L,
Right_Opnd => R);
- -- We reset the Entity since we do not want to bypass the operator
- -- resolution.
+ if Is_Record_Or_Limited_Type (Etype (Alt)) then
- Set_Entity (Cond, Empty);
+ -- We reset the Entity in order to use the primitive equality
+ -- of the type, as per RM 4.5.2 (28.1/4).
+
+ Set_Entity (Cond, Empty);
+ end if;
end if;
return Cond;