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 // iterator insert(const_iterator position, const value_type& x);
12
13 // REQUIRES: has-unix-headers
14 // UNSUPPORTED: !libcpp-has-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 int i = 4;
24 TEST_LIBCPP_ASSERT_FAILURE(v1.insert(v2.begin(), i),
25 "list::insert(iterator, x) called with an iterator not referring to this list");
26
27 return 0;
28 }
29