+2014-02-04 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch5.adb, einfo.ads, freeze.adb, sem_ch8.adb: Minor reformatting.
+
2014-02-04 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb: Change "runtime" to "run time" in warning message,
-- Is_Pure (Flag44)
-- Defined in all entities. Set in all entities of a unit to which a
--- pragma Pure is applied except for non intrinsic imported subprogram,
+-- pragma Pure is applied except for non-intrinsic imported subprograms,
-- and also set for the entity of the unit itself. In addition, this
-- flag may be set for any other functions or procedures that are known
-- to be side effect free, so in the case of subprograms, the Is_Pure
-- the element is a constant in the loop.
if No (Find_Value_Of_Aspect
- (Container_Typ, Aspect_Variable_Indexing))
+ (Container_Typ, Aspect_Variable_Indexing))
then
Set_Ekind (Id, E_Constant);
end if;
-- can bypass the normal check to ensure that pure units call only pure
-- subprograms.
+ -- The reason for the intrinsic exception is that in general, intrinsic
+ -- functions (such as shifts) are pure anyway. The only exceptions are
+ -- the intrinsics in GNAT.Source_Info, and that unit is not marked Pure
+ -- in any case, so no problem arises.
+
if Is_Imported (E)
and then Is_Pure (E)
and then not Has_Pragma_Pure_Function (E)
-- Set the Ekind of the entity, unless it has been set already, as is
-- the case for the iteration object over a container with no variable
- -- indexing.
+ -- indexing. In that case it's been marked as a constant, and we do not
+ -- want to change it to a variable.
if Ekind (Id) /= E_Constant then
Set_Ekind (Id, E_Variable);