Commit fd4647be by Arnaud Charlet

[multiple changes]

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.

From-SVN: r216372
parent a92230c5
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.
......
......@@ -6,7 +6,7 @@
-- --
-- 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- --
......@@ -481,7 +481,13 @@ package body Ada.Strings.Search is
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;
......@@ -507,7 +513,13 @@ package body Ada.Strings.Search is
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;
......@@ -533,7 +545,13 @@ package body Ada.Strings.Search is
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;
......
......@@ -33,7 +33,7 @@
-- 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;
......
......@@ -20388,10 +20388,19 @@ package body Sem_Ch3 is
-- 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
-- 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
......
......@@ -21917,9 +21917,11 @@ package body Sem_Prag is
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment