1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // <list>
10 
11 // void splice(const_iterator position, list<T,Allocator>& x, iterator i);
12 
13 // REQUIRES: has-unix-headers
14 // UNSUPPORTED: !libcpp-has-legacy-debug-mode, c++03
15 
16 #include <list>
17 
18 #include "check_assertion.h"
19 
main(int,char **)20 int main(int, char**) {
21     std::list<int> v1(3);
22     std::list<int> v2(3);
23     TEST_LIBCPP_ASSERT_FAILURE(
24         v1.splice(v1.begin(), v2, v1.begin()),
25         "list::splice(iterator, list, iterator) called with the second iterator not referring to the list argument");
26 
27   return 0;
28 }
29