summaryrefslogtreecommitdiff
path: root/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2018-07-27 03:07:09 +0000
committerEric Fiselier <eric@efcs.ca>2018-07-27 03:07:09 +0000
commita0866c5fb5020d15c69deda94d32a7f982b88dc9 (patch)
tree21a837f532a2332cb30f42329e972e68d76d6868 /test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp
parent47d2a98a330e8bae6f4c06363bfb9c25c2aa131b (diff)
Implement <filesystem>
This patch implements the <filesystem> header and uses that to provide <experimental/filesystem>. Unlike other standard headers, the symbols needed for <filesystem> have not yet been placed in libc++.so. Instead they live in the new libc++fs.a library. Users of filesystem are required to link this library. (Also note that libc++experimental no longer contains the definition of <experimental/filesystem>, which now requires linking libc++fs). The reason for keeping <filesystem> out of the dylib for now is that it's still somewhat experimental, and the possibility of requiring an ABI breaking change is very real. In the future the symbols will likely be moved into the dylib, or the dylib will be made to link libc++fs automagically). Note that moving the symbols out of libc++experimental may break user builds until they update to -lc++fs. This should be OK, because the experimental library provides no stability guarantees. However, I plan on looking into ways we can force libc++experimental to automagically link libc++fs. In order to use a single implementation and set of tests for <filesystem>, it has been placed in a special `__fs` namespace. This namespace is inline in C++17 onward, but not before that. As such implementation is available in C++11 onward, but no filesystem namespace is present "directly", and as such name conflicts shouldn't occur in C++11 or C++14. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@338093 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp')
-rw-r--r--test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp
new file mode 100644
index 000000000..21c4ed3b7
--- /dev/null
+++ b/test/std/input.output/filesystems/class.directory_iterator/directory_iterator.members/default_ctor.pass.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+
+// <filesystem>
+
+// class directory_iterator
+
+// directory_iterator::directory_iterator() noexcept
+
+
+#include "filesystem_include.hpp"
+#include <type_traits>
+#include <cassert>
+
+#include "test_macros.h"
+
+
+int main() {
+ {
+ static_assert(std::is_nothrow_default_constructible<fs::directory_iterator>::value, "");
+ }
+ {
+ fs::directory_iterator d1;
+ const fs::directory_iterator d2;
+ assert(d1 == d2);
+ }
+}