2020-06-19 Justin Squirek <squirek@adacore.com>
gcc/ada/
* sem_warn.adb (Warn_On_Known_Condition): Add general sanity
check that asserts the original source node being checked
contains an entity. If not, it could be the result of special
case expansion for type conversions.
if Constant_Condition_Warnings
and then Is_Known_Branch
and then Comes_From_Source (Orig)
+ and then Nkind (Orig) in N_Has_Entity
and then not In_Instance
then
-- Don't warn if comparison of result of attribute against a constant