summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 12:29:51 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 12:29:51 +0000
commit17a1cf0b533fb101214b4860548254c680392751 (patch)
tree2b1d5d993fc33ed6cfa13f3d2359ee294a235e55
parent41a8d10fcef79502c830a70bd8c4adce51a6386a (diff)
downloadgcc-17a1cf0b533fb101214b4860548254c680392751.tar.gz
2015-10-23 Bob Duff <duff@adacore.com>
* a-convec.adb (Copy): Make sure C is initialized on all paths, including when Checks is False. 2015-10-23 Eric Botcazou <ebotcazou@adacore.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove error as unreachable. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229242 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/a-convec.adb15
-rw-r--r--gcc/ada/sem_ch13.adb9
3 files changed, 18 insertions, 16 deletions
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 <duff@adacore.com>
+
+ * a-convec.adb (Copy): Make sure C is initialized
+ on all paths, including when Checks is False.
+
+2015-10-23 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Remove
+ error as unreachable.
+
2015-10-23 Arnaud Charlet <charlet@adacore.com>
* 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.