diff options
Diffstat (limited to 'gcc/ada/sem_ch9.adb')
-rw-r--r-- | gcc/ada/sem_ch9.adb | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb index b4a4c456dc5..4b284cd9599 100644 --- a/gcc/ada/sem_ch9.adb +++ b/gcc/ada/sem_ch9.adb @@ -1163,7 +1163,12 @@ package body Sem_Ch9 is begin if No_Run_Time_Mode then Error_Msg_CRT ("protected type", N); - goto Leave; + + if Has_Aspects (N) then + Analyze_Aspect_Specifications (N, Def_Id); + end if; + + return; end if; Tasking_Used := True; @@ -1205,6 +1210,13 @@ package body Sem_Ch9 is Set_Is_Constrained (T, not Has_Discriminants (T)); + -- If aspects are present, analyze them now. They can make references + -- to the discriminants of the type, but not to any components. + + if Has_Aspects (N) then + Analyze_Aspect_Specifications (N, Def_Id); + end if; + Analyze (Protected_Definition (N)); -- In the case where the protected type is declared at a nested level @@ -1287,11 +1299,6 @@ package body Sem_Ch9 is Process_Full_View (N, T, Def_Id); end if; end if; - - <<Leave>> - if Has_Aspects (N) then - Analyze_Aspect_Specifications (N, Def_Id); - end if; end Analyze_Protected_Type_Declaration; --------------------- @@ -2046,6 +2053,10 @@ package body Sem_Ch9 is Set_Is_Constrained (T, not Has_Discriminants (T)); + if Has_Aspects (N) then + Analyze_Aspect_Specifications (N, Def_Id); + end if; + if Present (Task_Definition (N)) then Analyze_Task_Definition (Task_Definition (N)); end if; @@ -2100,10 +2111,6 @@ package body Sem_Ch9 is Process_Full_View (N, T, Def_Id); end if; end if; - - if Has_Aspects (N) then - Analyze_Aspect_Specifications (N, Def_Id); - end if; end Analyze_Task_Type_Declaration; ----------------------------------- |