From: Justin Squirek Date: Thu, 30 Apr 2020 20:04:26 +0000 (-0400) Subject: [Ada] Spurious condition warning on type conversion in return X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=650abc2c93ab2e599df3053c8556e70de003dd79;p=gcc.git [Ada] Spurious condition warning on type conversion in return 2020-06-19 Justin Squirek 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. --- diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index fe9c46714d6..97d8a944f56 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -3520,6 +3520,7 @@ package body Sem_Warn is 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