20 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// std::prev10 11#include <iterator>12#include "test_iterators.h"13 14void test() {15 int arr[] = {1, 2};16 cpp17_input_iterator<int*> it(&arr[0]);17 it = std::prev(it);18 // expected-error-re@*:* {{static assertion failed due to requirement {{.*}}: Attempt to prev(it) with a non-bidirectional iterator}}19}20