diff options
author | Justin Squirek <squirek@adacore.com> | 2020-04-30 16:04:26 -0400 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:14:09 -0300 |
commit | da79ec2dc16ffdc2d4bb720e17577f1bd1b9a884 (patch) | |
tree | 5f60328f383c3539d6722d719fd63e9999419af5 | |
parent | a2b595369128e24c26b812cf29f1a906f1666715 (diff) | |
download | gcc-da79ec2dc16ffdc2d4bb720e17577f1bd1b9a884.zip gcc-da79ec2dc16ffdc2d4bb720e17577f1bd1b9a884.tar.gz gcc-da79ec2dc16ffdc2d4bb720e17577f1bd1b9a884.tar.bz2 |
[Ada] Spurious condition warning on type conversion in return
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.
-rw-r--r-- | gcc/ada/sem_warn.adb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index fe9c467..97d8a94 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 |