[Ada] Allow aspect Relaxed_Initialization on protected entries

Message ID 20200707092735.GA41418@adacore.com
State New
Headers show
Series
  • [Ada] Allow aspect Relaxed_Initialization on protected entries
Related show

Commit Message

Pierre-Marie de Rodat July 7, 2020, 9:27 a.m.
Fix the initial support for aspect Relaxed_Initialization based on the
finalized SPARK RM wording.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* sem_ch13.adb (Analyze_Relaxed_Parameter): Fix for protected
	entries.

Patch

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -2276,7 +2276,7 @@  package body Sem_Ch13 is
 
                --  Annotation of a subprogram; aspect expression is required
 
-               elsif Is_Subprogram (E) then
+               elsif Is_Subprogram_Or_Entry (E) then
                   if Present (Expr) then
 
                      --  If we analyze subprogram body that acts as its own