aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 8964bac611..bf42b0e 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1161,7 +1161,8 @@ package body Sem_Ch13 is
procedure Insert_Delayed_Pragma (Prag : Node_Id);
-- Insert a postcondition-like pragma into the tree depending on the
-- context. Prag must denote one of the following: Pre, Post, Depends,
- -- Global or Contract_Cases.
+ -- Global or Contract_Cases. This procedure is also used for the case
+ -- of Attach_Handler which has similar requirements for placement.
--------------------------------
-- Decorate_Aspect_And_Pragma --
@@ -1463,7 +1464,7 @@ package body Sem_Ch13 is
Check_Restriction_No_Specification_Of_Aspect (Aspect);
- -- Analyze this aspect (actual analysis is delayed till later)
+ -- Mark aspect analyzed (actual analysis is delayed till later)
Set_Analyzed (Aspect);
Set_Entity (Aspect, E);
@@ -1678,6 +1679,12 @@ package body Sem_Ch13 is
Expression => Relocate_Node (Expr))),
Pragma_Name => Name_Attach_Handler);
+ -- We need to insert this pragma into the tree to get proper
+ -- processing and to look valid from a placement viewpoint.
+
+ Insert_Delayed_Pragma (Aitem);
+ goto Continue;
+
-- Dynamic_Predicate, Predicate, Static_Predicate
when Aspect_Dynamic_Predicate |