From: Arnaud Charlet Date: Fri, 17 Oct 2014 08:45:39 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd4647be11610a204952ce71f01a870fdfe5b6df;p=gcc.git [multiple changes] 2014-10-17 Hristian Kirtchev * 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 * 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 * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Disable the consistency checks in ASIS mode. 2014-10-17 Arnaud Charlet * s-expmod.ads: Minor typo fix. From-SVN: r216372 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index b40757165ee..549f7fbff13 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,24 @@ +2014-10-17 Hristian Kirtchev + + * 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 + + * 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 + + * sem_prag.adb (Analyze_Refined_Depends_In_Decl_Part): Disable + the consistency checks in ASIS mode. + +2014-10-17 Arnaud Charlet + + * s-expmod.ads: Minor typo fix. + 2014-10-17 Robert Dewar * sem_util.adb: Minor reformatting. diff --git a/gcc/ada/a-strsea.adb b/gcc/ada/a-strsea.adb index 6f458ff2395..d45c7955a47 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 c90691523b0..df43c43f455 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 08dd79daaf9..6f685808157 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 62d9a03e441..cf447900f91 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