aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch5.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch5.adb')
-rw-r--r--gcc/ada/sem_ch5.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 0780140..2bf3383 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -807,7 +807,12 @@ package body Sem_Ch5 is
HSS : constant Node_Id := Handled_Statement_Sequence (N);
begin
- Check_Formal_Restriction ("block statement is not allowed", N);
+ -- Only reject block statements that originate from a source block
+ -- statement, in formal mode.
+
+ if Nkind (Original_Node (N)) = N_Block_Statement then
+ Check_Formal_Restriction ("block statement is not allowed", N);
+ end if;
-- If no handled statement sequence is present, things are really messed
-- up, and we just return immediately (defence against previous errors).