diff options
author | Robert Dewar <dewar@gnat.com> | 2001-12-05 01:06:25 +0000 |
---|---|---|
committer | Geert Bosch <bosch@gcc.gnu.org> | 2001-12-05 02:06:25 +0100 |
commit | 63db260effc0ce9622afe7c43fb8b4eabd5ad3f9 (patch) | |
tree | 2e1986a256c93952f2cdc37de5921659124ea2b8 /gcc/ada/errout.adb | |
parent | c6d289f47ef7f721d019b63c820494bc564e1bab (diff) | |
download | gcc-63db260effc0ce9622afe7c43fb8b4eabd5ad3f9.zip gcc-63db260effc0ce9622afe7c43fb8b4eabd5ad3f9.tar.gz gcc-63db260effc0ce9622afe7c43fb8b4eabd5ad3f9.tar.bz2 |
exp_util.adb: Minor reformatting from last change
* exp_util.adb: Minor reformatting from last change
* errout.adb (Check_For_Warning): For a Raised_Constraint_Error node
which is a rewriting of an expression, traverse the original
expression to remove warnings that may have been posted on it.
From-SVN: r47639
Diffstat (limited to 'gcc/ada/errout.adb')
-rw-r--r-- | gcc/ada/errout.adb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index ad64a5f..28b0c4c 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- $Revision: 1.208 $ +-- $Revision$ -- -- -- Copyright (C) 1992-2001 Free Software Foundation, Inc. -- -- -- @@ -1981,7 +1981,30 @@ package body Errout is E := Errors.Table (E).Next; end loop; - return OK; + if Nkind (N) = N_Raise_Constraint_Error + and then Original_Node (N) /= N + then + + -- Warnings may have been posted on subexpressions of + -- the original tree. We temporarily replace the raise + -- statement with the original expression to remove + -- those warnings, whose sloc do not match those of + -- any node in the current tree. + + declare + Old : Node_Id := N; + Status : Traverse_Result; + + begin + Rewrite (N, Original_Node (N)); + Status := Check_For_Warning (N); + Rewrite (N, Old); + return Status; + end; + + else + return OK; + end if; end Check_For_Warning; -- Start of processing for Remove_Warning_Messages |