]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Accept aspects Global and Depends on abstract subprograms
authorPiotr Trojanek <trojanek@adacore.com>
Mon, 21 Nov 2022 10:31:29 +0000 (11:31 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 22 Nov 2022 12:34:51 +0000 (13:34 +0100)
Aspects Global and Depends are now allowed on abstract subprograms
(as substitutes for Global'Class and Depends'Class).

This patch implements the recently modified rules SPARK RM 6.1.2(2-3).
The behavior for Contract_Cases and aspects on null subprograms stays
as it was.

gcc/ada/

* sem_prag.adb (Analyze_Depends_Global): Accept aspects on
abstract subprograms.

gcc/ada/sem_prag.adb

index f2c1a3f0e6eb8cca100433103908637500ceb53d..0a91518cff956e830dea5b1d53f4c74d6d033dbd 100644 (file)
@@ -4549,6 +4549,11 @@ package body Sem_Prag is
          elsif Nkind (Subp_Decl) = N_Single_Task_Declaration then
             null;
 
+         --  Abstract subprogram declaration
+
+         elsif Nkind (Subp_Decl) = N_Abstract_Subprogram_Declaration then
+            null;
+
          --  Subprogram body acts as spec
 
          elsif Nkind (Subp_Decl) = N_Subprogram_Body