summaryrefslogtreecommitdiff
path: root/gcc/ada/a-cihase.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 12:29:26 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-04-20 12:29:26 +0200
commit06f6c43f5c0d8df09010ec690b237bc62e3b6d02 (patch)
tree6433e0665b407b38446a2221561cc9a01bea3309 /gcc/ada/a-cihase.adb
parent71129dded17e960ee8fdfa2397e1eadee2568129 (diff)
downloadgcc-06f6c43f5c0d8df09010ec690b237bc62e3b6d02.tar.gz
[multiple changes]
2016-04-20 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch12.adb (Copy_Generic_Node): Handle the special qualification installed for universal literals that act as operands in binary or unary operators. (Qualify_Operand): Mark the qualification to signal the instantiation mechanism how to handle global reference propagation. * sinfo.adb (Is_Qualified_Universal_Literal): New routine. (Set_Is_Qualified_Universal_Literal): New routine. * sinfo.ads New attribute Is_Qualified_Universal_Literal along with occurrences in nodes. (Is_Qualified_Universal_Literal): New routine along with pragma Inline. (Set_Is_Qualified_Universal_Literal): New routine along with pragma Inline. 2016-04-20 Ed Schonberg <schonberg@adacore.com> * sem.adb (Do_Analyze): Save and restore Style_Max_Line_Length so that the corresponding checks are preserved across compilations that include System.Constants in their context. 2016-04-20 Gary Dismukes <dismukes@adacore.com> * sem_type.adb: Minor typo fix and reformatting. * a-conhel.ads: Update comment. 2016-04-20 Bob Duff <duff@adacore.com> * a-cihama.adb, a-cihase.adb, a-coinve.adb (Copy): Rewrite the code so it doesn't trigger an "uninit var" warning. From-SVN: r235256
Diffstat (limited to 'gcc/ada/a-cihase.adb')
-rw-r--r--gcc/ada/a-cihase.adb14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/ada/a-cihase.adb b/gcc/ada/a-cihase.adb
index ea7ee2211b4..6d913cbdeec 100644
--- a/gcc/ada/a-cihase.adb
+++ b/gcc/ada/a-cihase.adb
@@ -264,15 +264,15 @@ package body Ada.Containers.Indefinite_Hashed_Sets is
C : Count_Type;
begin
- if Capacity = 0 then
- C := Source.Length;
+ if Capacity < Source.Length then
+ if Checks and then Capacity /= 0 then
+ raise Capacity_Error
+ with "Requested capacity is less than Source length";
+ end if;
- elsif Capacity >= Source.Length then
+ C := Source.Length;
+ else
C := Capacity;
-
- elsif Checks then
- raise Capacity_Error
- with "Requested capacity is less than Source length";
end if;
return Target : Set do