From 2c6336bec3f0a2db44fa56e7448aaf119aa6665c Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 30 Jan 2015 16:06:14 +0100 Subject: [multiple changes] 2015-01-30 Gary Dismukes * freeze.adb: Minor reformatting. 2015-01-30 Javier Miranda * 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 * sem_warn.adb (Warn_On_Known_Condition): Do special casing of message for False case. 2015-01-30 Doug Rupp * 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 --- gcc/ada/sem_warn.adb | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'gcc/ada/sem_warn.adb') 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; -- cgit v1.1