28 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8//9 10// <iterator>11 12// __bounded_iter<_Iter>13 14// XFAIL: FROZEN-CXX03-HEADERS-FIXME15 16// Verify that __bounded_iter does not accept non-contiguous iterators as determined by __libcpp_is_contiguous_iterator.17// static_assert should be used, see https://llvm.org/PR115002.18// __wrap_iter cannot be so handled because it may directly wrap user-defined fancy pointers in libc++'s vector.19 20#include <deque>21#include <vector>22#include <array>23 24// expected-error-re@*:* {{static assertion failed due to requirement {{.*}}Only contiguous iterators can be adapted by __bounded_iter.}}25std::__bounded_iter<std::deque<int>::iterator> bounded_iter;26// expected-error-re@*:* {{static assertion failed due to requirement {{.*}}Only contiguous iterators can be adapted by __static_bounded_iter.}}27std::__static_bounded_iter<std::deque<int>::iterator, 42> statically_bounded_iter;28