]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Accept constants of access types as globals of side-effect function
authorPiotr Trojanek <trojanek@adacore.com>
Thu, 4 Jan 2024 18:58:07 +0000 (19:58 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 May 2024 07:55:51 +0000 (09:55 +0200)
Complete support for functions with side-effects.

gcc/ada/

* sem_prag.adb (Analyze_Global_Item): Handle side-effect
functions like procedures.

gcc/ada/sem_prag.adb

index 0eb4450dba3346d507593d7a2a5502fb1c84b27d..fa2a4cbed395465a8e45c9e8fbe371387a8a1484 100644 (file)
@@ -2860,7 +2860,9 @@ package body Sem_Prag is
                                                   | E_Procedure
                                                   | E_Generic_Procedure
                                                   | E_Task_Type
-                                 or else Is_Single_Task_Object (Spec_Id))
+                                 or else Is_Single_Task_Object (Spec_Id)
+                                 or else
+                                   Is_Function_With_Side_Effects (Spec_Id))
                      then
                         null;
                      else