diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-01-30 16:06:14 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-01-30 16:06:14 +0100 |
commit | 2c6336bec3f0a2db44fa56e7448aaf119aa6665c (patch) | |
tree | 8432c210f1c0904e02463c384d2865634f6ba147 /gcc/ada/sem_warn.adb | |
parent | 46413d9ea9ce2b3d5b59cc141842fa2d84d74b69 (diff) | |
download | gcc-2c6336bec3f0a2db44fa56e7448aaf119aa6665c.zip gcc-2c6336bec3f0a2db44fa56e7448aaf119aa6665c.tar.gz gcc-2c6336bec3f0a2db44fa56e7448aaf119aa6665c.tar.bz2 |
[multiple changes]
2015-01-30 Gary Dismukes <dismukes@adacore.com>
* freeze.adb: Minor reformatting.
2015-01-30 Javier Miranda <miranda@adacore.com>
* errout.ads (Error_Msg_PT): Replace Node_Id by Entity_Id and
improve its documentation.
* errout.adb (Error_Msg_PT): Improve the error message.
* sem_ch6.adb (Check_Conformance): Update call to Error_Msg_PT.
(Check_Synchronized_Overriding): Update call to Error_Msg_PT.
* sem_ch3.adb (Check_Abstract_Overriding): Code cleanup.
2015-01-30 Robert Dewar <dewar@adacore.com>
* sem_warn.adb (Warn_On_Known_Condition): Do special casing of
message for False case.
2015-01-30 Doug Rupp <rupp@adacore.com>
* s-vxwext-kernel.ads (Task_Cont): Remove imported subprogram body.
* s-vxwext-kernel.adb (Task_Cont): New subpprogram body specialized for
kernel.
From-SVN: r220284
Diffstat (limited to 'gcc/ada/sem_warn.adb')
-rw-r--r-- | gcc/ada/sem_warn.adb | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb index 1d0cfe6..355599b 100644 --- a/gcc/ada/sem_warn.adb +++ b/gcc/ada/sem_warn.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1999-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 1999-2015, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -3390,18 +3390,22 @@ package body Sem_Warn is Cond : Node_Id := C; begin - if Present (Parent (C)) and then Nkind (Parent (C)) = N_Op_Not + if Present (Parent (C)) + and then Nkind (Parent (C)) = N_Op_Not then True_Branch := not True_Branch; - Cond := Parent (C); + Cond := Parent (C); end if; + -- Condition always True + if True_Branch then if Is_Entity_Name (Original_Node (C)) and then Nkind (Cond) /= N_Op_Not then Error_Msg_NE - ("object & is always True?c?", Cond, Original_Node (C)); + ("object & is always True?c?", + Cond, Original_Node (C)); Track (Original_Node (C), Cond); else @@ -3409,9 +3413,21 @@ package body Sem_Warn is Track (Cond, Cond); end if; + -- Condition always False + else - Error_Msg_N ("condition is always False?c?", Cond); - Track (Cond, Cond); + if Is_Entity_Name (Original_Node (C)) + and then Nkind (Cond) /= N_Op_Not + then + Error_Msg_NE + ("object & is always False?c?", + Cond, Original_Node (C)); + Track (Original_Node (C), Cond); + + else + Error_Msg_N ("condition is always False?c?", Cond); + Track (Cond, Cond); + end if; end if; end; end if; |