elsif Orig_T = Base_Type (Standard_Long_Long_Integer) then
null;
+ -- Do not warn on conversion to class-wide type on helpers of
+ -- class-wide preconditions because in this context the warning
+ -- would be spurious (since the class-wide precondition has been
+ -- installed in the return statement of the helper, which has a
+ -- class-wide formal type instead of a regular tagged type).
+
+ elsif Is_Class_Wide_Type (Orig_T)
+ and then Is_Subprogram_Or_Generic_Subprogram (Current_Scope)
+ and then Present (Class_Preconditions_Subprogram (Current_Scope))
+ then
+ null;
+
-- Here we give the redundant conversion warning. If it is an
-- entity, give the name of the entity in the message. If not,
-- just mention the expression.