[mlir][PDLL] Allow (and ignore) `-D` tablegen macros. (#124166)
[llvm-project.git] / libcxx / test / std / input.output / filesystems / class.file_status / file_status.cons.pass.cpp
blob469fc3504c6b10d68b3a50f835ed6d943a487f0e
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11, c++14
11 // <filesystem>
13 // class file_status
15 // explicit file_status() noexcept;
16 // explicit file_status(file_type, perms prms = perms::unknown) noexcept;
18 #include <filesystem>
19 #include <type_traits>
20 #include <cassert>
22 #include "test_convertible.h"
24 #include "test_macros.h"
25 namespace fs = std::filesystem;
27 int main(int, char**) {
28 using namespace fs;
29 // Default ctor
31 static_assert(std::is_nothrow_default_constructible<file_status>::value,
32 "The default constructor must be noexcept");
33 static_assert(test_convertible<file_status>(),
34 "The default constructor must not be explicit");
35 const file_status f;
36 assert(f.type() == file_type::none);
37 assert(f.permissions() == perms::unknown);
40 // Unary ctor
42 static_assert(std::is_nothrow_constructible<file_status, file_type>::value,
43 "This constructor must be noexcept");
44 static_assert(!test_convertible<file_status, file_type>(),
45 "This constructor must be explicit");
47 const file_status f(file_type::not_found);
48 assert(f.type() == file_type::not_found);
49 assert(f.permissions() == perms::unknown);
51 // Binary ctor
53 static_assert(std::is_nothrow_constructible<file_status, file_type, perms>::value,
54 "This constructor must be noexcept");
55 static_assert(!test_convertible<file_status, file_type, perms>(),
56 "This constructor must b explicit");
57 const file_status f(file_type::regular, perms::owner_read);
58 assert(f.type() == file_type::regular);
59 assert(f.permissions() == perms::owner_read);
62 return 0;