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 // Can't test the system lib because this test enables debug mode
10 // UNSUPPORTED: with_system_cxx_lib=macosx
11 
12 // <list>
13 
14 // template <InputIterator Iter>
15 //   iterator insert(const_iterator position, Iter first, Iter last);
16 
17 
18 #define _LIBCPP_DEBUG 1
19 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
20 
21 #include <list>
22 #include <cstdlib>
23 #include <cassert>
24 #include "test_macros.h"
25 #include "test_iterators.h"
26 
main(int,char **)27 int main(int, char**)
28 {
29     {
30         std::list<int> v(100);
31         std::list<int> v2(100);
32         int a[] = {1, 2, 3, 4, 5};
33         const int N = sizeof(a)/sizeof(a[0]);
34         std::list<int>::iterator i = v.insert(next(v2.cbegin(), 10),
35                                         input_iterator<const int*>(a),
36                                        input_iterator<const int*>(a+N));
37         assert(false);
38     }
39 
40   return 0;
41 }
42