+2014-08-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch5.adb, sem_ch5.adb, einfo.ads: Minor reformatting.
+
+2014-08-04 Arnaud Charlet <charlet@adacore.com>
+
+ * sem_ch4.adb (Operator_Check): Refine previous change.
+
2014-08-04 Arnaud Charlet <charlet@adacore.com>
* sem_scil.ads: Improve comments.
-- as well as for record with private types as subtypes
-- Is_Processed_Transient (Flag252)
--- Defined in entities of variables and constants, including the loop
--- parameters of generalized iterators. Set when a transient object needs
--- to be finalized and it has already been processed by the transient
+-- Defined in variables, loop parameters, and constants, including the
+-- loop parameters of generalized iterators. Set when a transient object
+-- needs to be finalized and has already been processed by the transient
-- scope machinery. This flag signals the general finalization mechanism
-- to ignore the transient object.
Id : constant Entity_Id := Defining_Identifier (I_Spec);
Loc : constant Source_Ptr := Sloc (N);
- Container : constant Node_Id := Name (I_Spec);
- Container_Typ : constant Entity_Id := Base_Type (Etype (Container));
+ Container : constant Node_Id := Name (I_Spec);
+ Container_Typ : constant Entity_Id := Base_Type (Etype (Container));
I_Kind : constant Entity_Kind := Ekind (Id);
Cursor : Entity_Id;
Iterator : Entity_Id;
-- The cursor is only modified in expanded code, so it appears
-- as unassigned to the warning machinery. We must suppress
-- this spurious warning explicitly. The cursor's kind is that of
- -- the original loop parameter (it is a constant if the doamin of
+ -- the original loop parameter (it is a constant if the domain of
-- iteration is constant).
Set_Warnings_Off (Cursor);
return;
end if;
- elsif Nkind_In (N, N_Op_Eq, N_Op_Ne) then
- if Address_Integer_Convert_OK (Etype (R), Etype (L)) then
- Rewrite (R,
- Unchecked_Convert_To (Etype (L), Relocate_Node (R)));
- Analyze_Equality_Op (N);
- return;
- end if;
-
-- For an arithmetic operator or comparison operator, if one
-- of the operands is numeric, then we know the other operand
-- is not the same numeric type. If it is a non-numeric type,
end if;
return;
+
+ elsif Nkind_In (N, N_Op_Eq, N_Op_Ne) then
+ if Address_Integer_Convert_OK (Etype (R), Etype (L)) then
+ Rewrite (R,
+ Unchecked_Convert_To (Etype (L), Relocate_Node (R)));
+ Analyze_Equality_Op (N);
+ return;
+ end if;
end if;
-- If we fall through then just give general message. Note that in
-- If the expander is not active, or in SPARK mode, then we want to
-- analyze the loop body now even in the Ada 2012 iterator case, since
-- the rewriting will not be done. Insert the loop variable in the
- -- current scope, if not done when analysing the iteration scheme. Set
- -- is kind properly to detect improper uses in the loop body.
+ -- current scope, if not done when analysing the iteration scheme.
+ -- Set its kind properly to detect improper uses in the loop body.
if Present (Iter)
and then Present (Iterator_Specification (Iter))