1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 // Erasing items from the beginning or the end of a deque shall not invalidate iterators
14 // to items that were not erased.
16 #include "asan_testing.h"
20 #include "test_macros.h"
25 typename
C::iterator it1
= c
.begin() + 1;
26 typename
C::iterator it2
= c
.end() - 1;
30 typename
C::iterator it3
= c
.begin();
31 typename
C::iterator it4
= c
.end() - 1;
33 assert( *it1
== *it3
);
34 assert(&*it1
== &*it3
);
36 assert( *it2
== *it4
);
37 assert(&*it2
== &*it4
);
42 std::deque
<int> queue
;
43 for (int i
= 0; i
< 4098; ++i
)
46 while (queue
.size() > 1)
50 LIBCPP_ASSERT(is_double_ended_contiguous_container_asan_correct(queue
));