Home | History | Annotate | Download | only in list.modifiers
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // Can't test the system lib because this test enables debug mode
     11 // UNSUPPORTED: with_system_cxx_lib
     12 
     13 // <list>
     14 
     15 // Call erase(const_iterator first, const_iterator last); with second iterator from another container
     16 
     17 #define _LIBCPP_DEBUG 1
     18 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
     19 
     20 #include <list>
     21 #include <cassert>
     22 #include <cstdlib>
     23 
     24 int main()
     25 {
     26     int a1[] = {1, 2, 3};
     27     std::list<int> l1(a1, a1+3);
     28     std::list<int> l2(a1, a1+3);
     29     std::list<int>::iterator i = l1.erase(l1.cbegin(), next(l2.cbegin()));
     30     assert(false);
     31 }
     32