* sem_warn.adb (Warn_On_Known_Condition): Refine warning when applied
to a variable that is statically known to be constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103889
138bc75d-0d04-0410-961f-
82ee72b054a4
end if;
if True_Branch then
- Error_Msg_N ("condition is always True?", Cond);
+ if Is_Entity_Name (Original_Node (C))
+ and then Nkind (Cond) /= N_Op_Not
+ then
+ Error_Msg_NE
+ ("object & is always True?", Cond, Original_Node (C));
+ else
+ Error_Msg_N ("condition is always True?", Cond);
+ end if;
else
Error_Msg_N ("condition is always False?", Cond);
end if;