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
10
11 // <filesystem>
12
13 // class file_status
14
15 // file_type type() const noexcept;
16 // perms permissions(p) const noexcept;
17
18 #include "filesystem_include.h"
19 #include <type_traits>
20 #include <cassert>
21
22 #include "test_macros.h"
23
24
main(int,char **)25 int main(int, char**) {
26 using namespace fs;
27
28 const file_status st(file_type::regular, perms::owner_read);
29
30 // type test
31 {
32 static_assert(noexcept(st.type()),
33 "operation must be noexcept");
34 static_assert(std::is_same<decltype(st.type()), file_type>::value,
35 "operation must return file_type");
36 assert(st.type() == file_type::regular);
37 }
38 // permissions test
39 {
40 static_assert(noexcept(st.permissions()),
41 "operation must be noexcept");
42 static_assert(std::is_same<decltype(st.permissions()), perms>::value,
43 "operation must return perms");
44 assert(st.permissions() == perms::owner_read);
45 }
46
47 return 0;
48 }
49