+2014-10-17 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch3.adb (Propagate_Default_Init_Cond_Attributes): A derived type
+ inherits the attributes related to pragma Default_Initial_Condition
+ from its parent type.
+
+2014-10-17 Ed Schonberg <schonberg@adacore.com>
+
+ * a-strsea.adb (Index - versions with a From parameter):
+ According to AI05-056, the Index functions with a From parameter
+ return 0 if the source is an empty string.
+
+2014-10-17 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Disable
+ the consistency checks in ASIS mode.
+
+2014-10-17 Arnaud Charlet <charlet@adacore.com>
+
+ * s-expmod.ads: Minor typo fix.
+
2014-10-17 Robert Dewar <dewar@adacore.com>
* sem_util.adb: Minor reformatting.
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2014, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
Mapping : Maps.Character_Mapping := Maps.Identity) return Natural
is
begin
- if Going = Forward then
+
+ -- AI05-056 : if source is empty result is always 0.
+
+ if Source'Length = 0 then
+ return 0;
+
+ elsif Going = Forward then
if From < Source'First then
raise Index_Error;
end if;
Mapping : Maps.Character_Mapping_Function) return Natural
is
begin
- if Going = Forward then
+
+ -- AI05-056 : if source is empty result is always 0.
+
+ if Source'Length = 0 then
+ return 0;
+
+ elsif Going = Forward then
if From < Source'First then
raise Index_Error;
end if;
Going : Direction := Forward) return Natural
is
begin
- if Going = Forward then
+
+ -- AI05-056 : if source is empty result is always 0.
+
+ if Source'Length = 0 then
+ return 0;
+
+ elsif Going = Forward then
if From < Source'First then
raise Index_Error;
end if;
-- modulus values. Arithmetic is done in Long_Long_Unsigned, with explicit
-- accounting for the modulus value which is passed as the second argument.
-- Note that 1 is a binary modulus (2**0), so the compiler should not (and
--- will not) call this function with Modulus equal to 1).
+-- will not) call this function with Modulus equal to 1.
with System.Unsigned_Types;
-- Start of processing for Propagate_Default_Init_Cond_Attributes
begin
- -- A full view inherits the attributes from its private view
-
if Has_Default_Init_Cond (From_Typ) then
- Set_Has_Default_Init_Cond (To_Typ);
+
+ -- A derived type inherits the attributes from its parent type
+
+ if Parent_To_Derivation then
+ Set_Has_Inherited_Default_Init_Cond (To_Typ);
+
+ -- A full view shares the attributes with its private view
+
+ else
+ Set_Has_Default_Init_Cond (To_Typ);
+ end if;
+
Inherit_Procedure := True;
-- Due to the order of expansion, a derived private type is processed
Analyze_Depends_In_Decl_Part (N);
-- Do not match dependencies against refinements if Refined_Depends is
- -- illegal to avoid emitting misleading error.
+ -- illegal to avoid emitting misleading error. Matching is disabled in
+ -- ASIS because clauses are not normalized as this is a tree altering
+ -- activity similar to expansion.
- if Serious_Errors_Detected = Errors then
+ if Serious_Errors_Detected = Errors and then not ASIS_Mode then
-- Multiple dependency clauses appear as component associations of an
-- aggregate. Note that the clauses are copied because the algorithm