Routine Resolve_Membership_Op didn't reference its Typ parameter and
instead suppressed warning with a suspicious pragma Warning. This could
be rather pragma Unreferenced, but actually we can reference the type in
assertion that enforces an existing comment.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

        * sem_res.adb (Resolve_Membership_Op): Replace pragma Warnings
        with pragma Assert.
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -9619,7 +9619,7 @@ package body Sem_Res is
    --  universal types applies.
 
    procedure Resolve_Membership_Op (N : Node_Id; Typ : Entity_Id) is
-      pragma Warnings (Off, Typ);
+      pragma Assert (Is_Boolean_Type (Typ));
 
       L : constant Node_Id := Left_Opnd  (N);
       R : constant Node_Id := Right_Opnd (N);


Reply via email to