diff options
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r-- | gcc/ada/sem_prag.adb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 3876198..7442da1 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2467,10 +2467,11 @@ package body Sem_Prag is elsif SPARK_Mode = On and then Ekind (Item_Id) = E_Variable - and then Is_Effectively_Volatile (Item_Id) + and then Is_Effectively_Volatile_For_Reading (Item_Id) then - -- An effectively volatile object cannot appear as a global - -- item of a nonvolatile function (SPARK RM 7.1.3(8)). + -- An effectively volatile object for reading cannot appear + -- as a global item of a nonvolatile function (SPARK RM + -- 7.1.3(8)). if Ekind (Spec_Id) in E_Function | E_Generic_Function and then not Is_Volatile_Function (Spec_Id) |