When condition of a quantification expression is written as True or False, then
the user has likely done this on purpose and there is no need for a warning.
gcc/ada/ChangeLog:
* sem_ch4.adb (Analyze_Quantified_Expression): Suppress warning for
trivial conditions.
and then not Is_Internal_Name (Chars (Loop_Id))
and then not Has_Junk_Name (Loop_Id)
then
- if not Referenced (Loop_Id, Cond) then
- Error_Msg_N ("?.t?unused variable &", Loop_Id);
- else
+ if Referenced (Loop_Id, Cond) then
Check_Subexpr (Cond, Kind => Full);
+ elsif not Is_Trivial_Boolean (Cond) then
+ Error_Msg_N ("?.t?unused variable &", Loop_Id);
end if;
end if;
end;