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// UNSUPPORTED: c++03, c++11, c++14
10// UNSUPPORTED: availability-filesystem-missing
11
12// <filesystem>
13
14// class path;
15// enum class format;
16
17#include <filesystem>
18#include <type_traits>
19#include <cassert>
20
21#include "test_macros.h"
22namespace fs = std::filesystem;
23
24int main(int, char**) {
25 typedef fs::path::format E;
26 static_assert(std::is_enum<E>::value, "");
27
28 LIBCPP_STATIC_ASSERT(std::is_same<std::underlying_type<E>::type, unsigned char>::value, ""); // Implementation detail
29
30 static_assert(
31 E::auto_format != E::native_format &&
32 E::auto_format != E::generic_format &&
33 E::native_format != E::generic_format,
34 "Expected enumeration values are not unique");
35
36 return 0;
37}
38

source code of libcxx/test/std/input.output/filesystems/fs.enum/enum.path.format.pass.cpp