aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2014-10-17 10:45:39 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2014-10-17 10:45:39 +0200
commitfd4647be11610a204952ce71f01a870fdfe5b6df (patch)
tree2c3b5634af0ef31610270b79b847ac11dab83425
parenta92230c56ce41b83e1ec67bdaadec26b0eb41de9 (diff)
downloadgcc-fd4647be11610a204952ce71f01a870fdfe5b6df.zip
gcc-fd4647be11610a204952ce71f01a870fdfe5b6df.tar.gz
gcc-fd4647be11610a204952ce71f01a870fdfe5b6df.tar.bz2
[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
-rw-r--r--gcc/ada/ChangeLog21
-rw-r--r--gcc/ada/a-strsea.adb26
-rw-r--r--gcc/ada/s-expmod.ads2
-rw-r--r--gcc/ada/sem_ch3.adb15
-rw-r--r--gcc/ada/sem_prag.adb6
5 files changed, 60 insertions, 10 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index b407571..549f7fb 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,24 @@
+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.
diff --git a/gcc/ada/a-strsea.adb b/gcc/ada/a-strsea.adb
index 6f458ff..d45c795 100644
--- a/gcc/ada/a-strsea.adb
+++ b/gcc/ada/a-strsea.adb
@@ -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;
diff --git a/gcc/ada/s-expmod.ads b/gcc/ada/s-expmod.ads
index c906915..df43c43 100644
--- a/gcc/ada/s-expmod.ads
+++ b/gcc/ada/s-expmod.ads
@@ -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;
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 08dd79d..6f68580 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -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
- 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
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 62d9a03..cf44790 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -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