===================================================================
@@ -7152,8 +7152,11 @@
return;
end if;
- Typl := Base_Type (Typl);
+ -- Now get the implementation base type (note that plain Base_Type here
+ -- might lead us back to the private type, which is not what we want!)
+ Typl := Implementation_Base_Type (Typl);
+
-- Equality between variant records results in a call to a routine
-- that has conditional tests of the discriminant value(s), and hence
-- violates the No_Implicit_Conditionals restriction.
===================================================================
@@ -4246,6 +4246,11 @@
-- point operands if the Treat_Fixed_As_Integer flag is set and will
-- thus treat these nodes in identical manner, ignoring small values.
+ -- Note on equality/inequality tests for records. In the expanded tree,
+ -- record comparisons are always expanded to be a series of component
+ -- comparisons, so the back end will never see an equality or inequality
+ -- operation with operands of a record type.
+
-- Note on overflow handling: When the overflow checking mode is set to
-- MINIMIZED or ELIMINATED, nodes for signed arithmetic operations may
-- be modified to use a larger type for the operands and result. In