summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch11.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 20:02:45 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-26 20:02:45 +0000
commit261a23bc4f7fbd525cb2f73582743252d2d2f8ac (patch)
treef3c8a991bcf4caac8dd5516247a2d92c9f77ee3b /gcc/ada/sem_ch11.adb
parent0c164b6eab526a1d0db4a3d08058262ddd476be6 (diff)
downloadgcc-261a23bc4f7fbd525cb2f73582743252d2d2f8ac.tar.gz
2008-03-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r133612 (in particular gcc/Makefile.in with auto dependencies) git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@133613 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch11.adb')
-rw-r--r--gcc/ada/sem_ch11.adb24
1 files changed, 14 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch11.adb b/gcc/ada/sem_ch11.adb
index 66cfc88a993..2be74709f09 100644
--- a/gcc/ada/sem_ch11.adb
+++ b/gcc/ada/sem_ch11.adb
@@ -437,7 +437,6 @@ package body Sem_Ch11 is
Exception_Id : constant Node_Id := Name (N);
Exception_Name : Entity_Id := Empty;
P : Node_Id;
- Nkind_P : Node_Kind;
begin
Check_Unreachable_Code (N);
@@ -484,16 +483,13 @@ package body Sem_Ch11 is
if No (Exception_Id) then
P := Parent (N);
- Nkind_P := Nkind (P);
-
- while Nkind_P /= N_Exception_Handler
- and then Nkind_P /= N_Subprogram_Body
- and then Nkind_P /= N_Package_Body
- and then Nkind_P /= N_Task_Body
- and then Nkind_P /= N_Entry_Body
+ while not Nkind_In (P, N_Exception_Handler,
+ N_Subprogram_Body,
+ N_Package_Body,
+ N_Task_Body,
+ N_Entry_Body)
loop
P := Parent (P);
- Nkind_P := Nkind (P);
end loop;
if Nkind (P) /= N_Exception_Handler then
@@ -506,7 +502,15 @@ package body Sem_Ch11 is
else
Set_Local_Raise_Not_OK (P);
- Check_Restriction (No_Exception_Propagation, N);
+
+ -- Do not check the restriction if the reraise statement is part
+ -- of the code generated for an AT-END handler. That's because
+ -- if the restriction is actually active, we never generate this
+ -- raise anyway, so the apparent violation is bogus.
+
+ if not From_At_End (N) then
+ Check_Restriction (No_Exception_Propagation, N);
+ end if;
end if;
-- Normal case with exception id present