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 // list(list&& c); 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 **)20int main(int, char**) { 21 std::list<int> l1; 22 l1.push_back(1); l1.push_back(2); l1.push_back(3); 23 std::list<int>::iterator i = l1.begin(); 24 std::list<int> l2 = l1; 25 TEST_LIBCPP_ASSERT_FAILURE(l2.erase(i), "list::erase(iterator) called with an iterator not referring to this list"); 26 27 return 0; 28 } 29