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 path
14 
15 // void clear() noexcept
16 
17 #include "filesystem_include.h"
18 #include <type_traits>
19 #include <cassert>
20 
21 #include "test_macros.h"
22 #include "test_iterators.h"
23 #include "count_new.h"
24 #include "filesystem_test_helper.h"
25 
26 
main(int,char **)27 int main(int, char**) {
28   using namespace fs;
29   {
30     path p;
31     ASSERT_NOEXCEPT(p.clear());
32     ASSERT_SAME_TYPE(void, decltype(p.clear()));
33     p.clear();
34     assert(p.empty());
35   }
36   {
37     const path p("/foo/bar/baz");
38     path p2(p);
39     assert(p == p2);
40     p2.clear();
41     assert(p2.empty());
42   }
43 
44   return 0;
45 }
46