Add a missing debug assertion in <list>.
authorArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Sun, 18 Apr 2021 17:55:54 +0000 (13:55 -0400)
committerArthur O'Dwyer <arthur.j.odwyer@gmail.com>
Sun, 18 Apr 2021 23:40:17 +0000 (19:40 -0400)
This came up in D100595.

Differential Revision: https://reviews.llvm.org/D100728

libcxx/include/list

index cfb28e8..7d616fa 100644 (file)
@@ -2099,6 +2099,9 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
     _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == &__c,
         "list::splice(iterator, list, iterator, iterator) called with second iterator not"
         " referring to list argument");
+    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == &__c,
+        "list::splice(iterator, list, iterator, iterator) called with third iterator not"
+        " referring to list argument");
     if (this == &__c)
     {
         for (const_iterator __i = __f; __i != __l; ++__i)