aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Squirek <squirek@adacore.com>2021-02-27 19:09:48 -0500
committerPierre-Marie de Rodat <derodat@adacore.com>2021-06-16 04:43:01 -0400
commitc5dc00ef38d2c3ac647726b0215888f75b0e4d9c (patch)
tree9196c769bfeca31cece20a6f4690dad5469059ed
parentf5b4b6bf14a571df07021936c29b4773beb80324 (diff)
downloadgcc-c5dc00ef38d2c3ac647726b0215888f75b0e4d9c.zip
gcc-c5dc00ef38d2c3ac647726b0215888f75b0e4d9c.tar.gz
gcc-c5dc00ef38d2c3ac647726b0215888f75b0e4d9c.tar.bz2
[Ada] Non-static Interrupt_Priority allowed with restriction Static_Priorities
gcc/ada/ * sem_ch13.adb (Make_Aitem_Pragma): Check for static expressions in Priority aspect arguments for restriction Static_Priorities.
-rw-r--r--gcc/ada/sem_ch13.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 8aa62c8..4fa17f1 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -3382,6 +3382,13 @@ package body Sem_Ch13 is
| Aspect_Interrupt_Priority
| Aspect_Priority
=>
+ -- Verify the expression is static when Static_Priorities is
+ -- enabled.
+
+ if not Is_OK_Static_Expression (Expr) then
+ Check_Restriction (Static_Priorities, Expr);
+ end if;
+
if Nkind (N) in N_Subprogram_Body | N_Subprogram_Declaration
then
-- Analyze the aspect expression