summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_warn.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 08:04:04 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-09-05 08:04:04 +0000
commitc227996d911cd314e730619596e64e5a9961bd57 (patch)
treeb08b3396ac470a25a64c9074df48670192c7104e /gcc/ada/sem_warn.adb
parent656265fbd5caa525ea16001352055f6b062fcf7d (diff)
downloadgcc-c227996d911cd314e730619596e64e5a9961bd57.tar.gz
2005-09-01 Ed Schonberg <schonberg@adacore.com>
* 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
Diffstat (limited to 'gcc/ada/sem_warn.adb')
-rw-r--r--gcc/ada/sem_warn.adb9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index 2b3dfc8d420..d3003df5400 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -1648,7 +1648,14 @@ package body Sem_Warn is
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;