+2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_res.adb (Resolve_Op_Not): Do not rewrite an equality
+ operator into a function call when the operator is intrinsic.
+
2019-07-11 Thomas Quinot <quinot@adacore.com>
* sem_prag.adb (Analyze_Pragma, case pragma Check): Do not call
declare
Opnd : constant Node_Id := Right_Opnd (N);
+ Op_Id : Entity_Id;
+
begin
if B_Typ = Standard_Boolean
and then Nkind_In (Opnd, N_Op_Eq, N_Op_Ne)
and then Is_Overloaded (Opnd)
then
Resolve_Equality_Op (Opnd, B_Typ);
+ Op_Id := Entity (Opnd);
- if Ekind (Entity (Opnd)) = E_Function then
- Rewrite_Operator_As_Call (Opnd, Entity (Opnd));
+ if Ekind (Op_Id) = E_Function
+ and then not Is_Intrinsic_Subprogram (Op_Id)
+ then
+ Rewrite_Operator_As_Call (Opnd, Op_Id);
end if;
if not Inside_A_Generic or else Is_Entity_Name (Opnd) then
+2019-07-11 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * gnat.dg/equal9.adb: New testcase.
+
2019-07-11 Thomas Quinot <quinot@adacore.com>
* gnat.dg/scos1.adb: New testcase.
--- /dev/null
+-- { dg-do run }
+
+with Ada.Text_IO; use Ada.Text_IO;
+with System; use System;
+
+procedure Equal9 is
+ Val : Address := Null_Address;
+begin
+ if Val = Null_Address then
+ Put_Line ("= OK");
+ else
+ raise Program_Error;
+ end if;
+
+ if Val /= Null_Address then
+ raise Program_Error;
+ else
+ Put_Line ("/= OK");
+ end if;
+
+ if not (Val = Null_Address) then
+ raise Program_Error;
+ else
+ Put_Line ("not = OK");
+ end if;
+end Equal9;