aboutsummaryrefslogtreecommitdiff
path: root/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp
blob: 5a6f5304a0618cd9169b32cfe62ab9e554c64a28 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// UNSUPPORTED: c++98, c++03

// <experimental/filesystem>

// class path

#include <experimental/filesystem>
#include <iterator>


namespace fs = std::experimental::filesystem;

int main() {
  using namespace fs;
  using RIt = std::reverse_iterator<path::iterator>;

  // expected-error-re@iterator:* {{static_assert failed{{.*}} "The specified iterator type cannot be used with reverse_iterator; Using stashing iterators with reverse_iterator causes undefined behavior"}}
  {
    RIt r;
    ((void)r);
  }
}