summaryrefslogtreecommitdiffstats
path: root/gcc/ada/a-cdlili.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-04 14:00:29 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2011-11-04 14:00:29 +0000
commitc19abba74833ed64e23acbaae906011b607794e3 (patch)
tree6faef4762f1e148699e2e63fb88c2fc56f034a7d /gcc/ada/a-cdlili.adb
parent7f9f76a0c284235b5310019b466a61fe586da123 (diff)
downloadppe42-gcc-c19abba74833ed64e23acbaae906011b607794e3.tar.gz
ppe42-gcc-c19abba74833ed64e23acbaae906011b607794e3.zip
2011-11-04 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Minor reformatting. 2011-11-04 Matthew Heaney <heaney@adacore.com> * a-convec.adb, a-coinve.adb, a-cobove.adb (Merge): Raise PE when Target and Source denote same non-empty object * a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb (Merge): Ditto 2011-11-04 Robert Dewar <dewar@adacore.com> * exp_attr.adb: Minor reformatting. 2011-11-04 Ed Schonberg <schonberg@adacore.com> * exp_ch5.adb (Expand_Assign_Record): Do not generate a discriminant assignment within an initialization proc if the record is an unchecked union, as it can only come from the initialization of an unchecked union component. 2011-11-04 Robert Dewar <dewar@adacore.com> * gnat_ugn.texi: Minor reformatting. 2011-11-04 Robert Dewar <dewar@adacore.com> * par-labl.adb (Rewrite_As_Loop): Generate info msg rather than warning message. 2011-11-04 Robert Dewar <dewar@adacore.com> * exp_ch4.adb: Minor code reorganization (remove junk obsolete var Save_Space). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180954 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-cdlili.adb')
-rw-r--r--gcc/ada/a-cdlili.adb16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/ada/a-cdlili.adb b/gcc/ada/a-cdlili.adb
index 326c74b0785..8b513222ef8 100644
--- a/gcc/ada/a-cdlili.adb
+++ b/gcc/ada/a-cdlili.adb
@@ -515,10 +515,24 @@ package body Ada.Containers.Doubly_Linked_Lists is
LI, RI : Cursor;
begin
- if Target'Address = Source'Address then
+
+ -- The semantics of Merge changed slightly per AI05-0021. It was
+ -- originally the case that if Target and Source denoted the same
+ -- container object, then the GNAT implementation of Merge did
+ -- nothing. However, it was argued that RM05 did not precisely
+ -- specify the semantics for this corner case. The decision of the
+ -- ARG was that if Target and Source denote the same non-empty
+ -- container object, then Program_Error is raised.
+
+ if Source.Is_Empty then
return;
end if;
+ if Target'Address = Source'Address then
+ raise Program_Error with
+ "Target and Source denote same non-empty container";
+ end if;
+
if Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
OpenPOWER on IntegriCloud