[Ada] Freeze aspect expression relocated to pragma Precondition
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 12 May 2020 19:17:08 +0000 (21:17 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 7 Jul 2020 09:26:57 +0000 (05:26 -0400)
gcc/ada/

* contracts.adb (Analyze_Entry_Or_Subprogram_Contract,
Process_Preconditions_For): Freeze expression that has been
relocated to pragma Precondition, not the expression which is
still in the aspect.

gcc/ada/contracts.adb

index 99313348b27a5c60e9c151e38999e7bcf5c2015b..50d842244c1d00a0d8ddf219c3807799cc12986f 100644 (file)
@@ -653,7 +653,9 @@ package body Contracts is
                      Freeze_Expr_Types
                        (Def_Id => Subp_Id,
                         Typ    => Standard_Boolean,
-                        Expr   => Expression (Corresponding_Aspect (Prag)),
+                        Expr   =>
+                          Expression
+                            (First (Pragma_Argument_Associations (Prag))),
                         N      => Bod);
                   end if;
 
@@ -2603,7 +2605,9 @@ package body Contracts is
                         Freeze_Expr_Types
                           (Def_Id => Subp_Id,
                            Typ    => Standard_Boolean,
-                           Expr   => Expression (Corresponding_Aspect (Prag)),
+                           Expr   =>
+                             Expression
+                               (First (Pragma_Argument_Associations (Prag))),
                            N      => Body_Decl);
                      end if;