+2019-08-14 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch4.adb (Expand_N_Quantified_Expression): Freeze
+ explicitly the type of the loop parameter.
+
2019-08-14 Javier Miranda <miranda@adacore.com>
* sem_util.adb (New_Copy_Tree.Copy_Node_With_Replacement):
Flag : Entity_Id;
Scheme : Node_Id;
Stmts : List_Id;
+ Var : Entity_Id;
begin
+ -- Ensure that the bound variable is properly frozen. We must do
+ -- this before expansion because the expression is about to be
+ -- converted into a loop, and resulting freeze nodes may end up
+ -- in the wrong place in the tree.
+
+ if Present (Iter_Spec) then
+ Var := Defining_Identifier (Iter_Spec);
+ else
+ Var := Defining_Identifier (Loop_Spec);
+ end if;
+
+ declare
+ P : Node_Id := Parent (N);
+ begin
+ while Nkind (P) in N_Subexpr loop
+ P := Parent (P);
+ end loop;
+
+ Freeze_Before (P, Etype (Var));
+ end;
+
-- Create the declaration of the flag which tracks the status of the
-- quantified expression. Generate:
+2019-08-14 Ed Schonberg <schonberg@adacore.com>
+
+ * gnat.dg/assert2.adb, gnat.dg/assert2.ads: New testcase.
+
2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/inline18.adb, gnat.dg/inline18.ads,
--- /dev/null
+-- { dg-do compile }
+
+package body Assert2 is
+ procedure Dummy is null;
+end Assert2;
--- /dev/null
+package Assert2
+ with SPARK_Mode
+is
+ type Living is new Integer;
+ function Is_Martian (Unused : Living) return Boolean is (False);
+
+ function Is_Green (Unused : Living) return Boolean is (True);
+
+ pragma Assert
+ (for all M in Living => (if Is_Martian (M) then Is_Green (M)));
+ pragma Assert
+ (for all M in Living => (if Is_Martian (M) then not Is_Green (M)));
+
+ procedure Dummy;
+end Assert2;