From: Arnaud Charlet Date: Fri, 23 Oct 2015 12:29:51 +0000 (+0200) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d742bfc0094db87c2c8c4f061d649ff4816b56bc;p=gcc.git [multiple changes] 2015-10-23 Bob Duff * a-convec.adb (Copy): Make sure C is initialized on all paths, including when Checks is False. 2015-10-23 Eric Botcazou * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove error as unreachable. From-SVN: r229242 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 4851d5dbc41..e17fa0c5422 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2015-10-23 Bob Duff + + * a-convec.adb (Copy): Make sure C is initialized + on all paths, including when Checks is False. + +2015-10-23 Eric Botcazou + + * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove + error as unreachable. + 2015-10-23 Arnaud Charlet * gnat1drv.adb (Adjust_Global_Switches): Adjust. diff --git a/gcc/ada/a-convec.adb b/gcc/ada/a-convec.adb index ff11fa95272..c009b6b9088 100644 --- a/gcc/ada/a-convec.adb +++ b/gcc/ada/a-convec.adb @@ -346,15 +346,16 @@ package body Ada.Containers.Vectors is C : Count_Type; begin - if Capacity = 0 then - C := Source.Length; - - elsif Capacity >= Source.Length then + if Capacity >= Source.Length then C := Capacity; - elsif Checks then - raise Capacity_Error with - "Requested capacity is less than Source length"; + else + C := Source.Length; + + if Checks and then Capacity /= 0 then + raise Capacity_Error with + "Requested capacity is less than Source length"; + end if; end if; return Target : Vector do diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 8b1287c1ef9..02e5ed33ab6 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -4808,15 +4808,6 @@ package body Sem_Ch13 is end if; end; - if Is_Exported (U_Ent) then - Error_Msg_N - ("& cannot be exported if an address clause is given", - Nam); - Error_Msg_N - ("\define and export a variable " - & "that holds its address instead", Nam); - end if; - -- Entity has delayed freeze, so we will generate an -- alignment check at the freeze point unless suppressed.