]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] The definition of constants in declare expressions is an interfering context
authorClaire Dross <dross@adacore.com>
Tue, 21 Apr 2020 12:15:22 +0000 (14:15 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 18 Jun 2020 09:08:15 +0000 (05:08 -0400)
2020-06-18  Claire Dross  <dross@adacore.com>

gcc/ada/

* sem_util.adb (Is_OK_Volatile_Context): Return False on
definitions of constants declared in declare expressions.

gcc/ada/sem_util.adb

index eb9c9f68a9154630996deb3f0a6422ca4d0df85b..52a3f947dbe338df6dcece6ad9bdf46e411a93bb 100644 (file)
@@ -17298,6 +17298,7 @@ package body Sem_Util is
       elsif Nkind (Context) = N_Object_Declaration
         and then Present (Expression (Context))
         and then Expression (Context) = Obj_Ref
+        and then Nkind (Parent (Context)) /= N_Expression_With_Actions
       then
          Obj_Id := Defining_Entity (Context);