@@ -1665,16 +1665,21 @@
-- If the domain of iteration is an expression, create a declaration for
-- it, so that finalization actions are introduced outside of the loop.
-- The declaration must be a renaming because the body of the loop may
- -- assign to elements. When the context is a quantified expression, the
- -- renaming declaration is delayed until the expansion phase.
+ -- assign to elements.
if not Is_Entity_Name (Iter_Name)
+ -- When the context is a quantified expression, the renaming
+ -- declaration is delayed until the expansion phase if we are
+ -- doing expansion.
and then (Nkind (Parent (N)) /= N_Quantified_Expression
+ or else Operating_Mode = Check_Semantics)
- -- The following two tests need comments ???
+ -- Do not perform this expansion in Alfa mode, since the formal
+ -- verification directly deals with the source form of the iterator.
- or else Operating_Mode = Check_Semantics
- or else Alfa_Mode)
+ and then not Alfa_Mode
Id : constant Entity_Id := Make_Temporary (Loc, 'R', Iter_Name);
@@ -1711,7 +1716,7 @@
-- Container is an entity or an array with uncontrolled components, or
-- else it is a container iterator given by a function call, typically
-- called Iterate in the case of predefined containers, even though
- -- Iterate is not a reserved name. What matter is that the return type
+ -- Iterate is not a reserved name. What matters is that the return type
-- of the function is an iterator type.
elsif Is_Entity_Name (Iter_Name) then