-- d_n
-- d_o
-- d_p Ignore assertion pragmas for elaboration
- -- d_q
+ -- d_q Do not enforce freezing for equality operator of boolean subtype
-- d_r Disable the use of the return slot in functions
-- d_s Stop elaboration checks on synchronous suspension
-- d_t In LLVM-based CCG, dump LLVM IR after transformations are done
-- semantics of invariants and postconditions in both the static and
-- dynamic elaboration models.
+ -- d_q The compiler does not enforce the new freezing rule introduced for
+ -- primitive equality operators in Ada 2012 when the operator returns
+ -- a subtype of Boolean.
+
-- d_r The compiler does not make use of the return slot in the expansion
-- of functions returning a by-reference type. If this use is required
-- for these functions to return on the primary stack, then they are
<<Check_Inequality>>
if Chars (S) = Name_Op_Eq
- and then Etype (S) = Standard_Boolean
+ and then Base_Type (Etype (S)) = Standard_Boolean
and then Present (Parent (S))
and then not Is_Dispatching_Operation (S)
then
Make_Inequality_Operator (S);
- Check_Untagged_Equality (S);
+
+ -- The freezing rule introduced in Ada 2012 was historically
+ -- not enforced for operators returning a subtype of Boolean.
+
+ if Etype (S) = Standard_Boolean
+ or else not Debug_Flag_Underscore_Q
+ then
+ Check_Untagged_Equality (S);
+ end if;
end if;
end New_Overloaded_Entity;