[libcxx-commits] [libcxx] [libc++] use copy_file_range for fs::copy (PR #109211)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 1 07:26:27 PDT 2024


Jannik =?utf-8?q?Glückert?= <jannik.glueckert at gmail.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/109211 at github.com>


================
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14
+// REQUIRES: linux
+// UNSUPPORTED: no-filesystem
+// UNSUPPORTED: availability-filesystem-missing
+
+// <filesystem>
+
+// bool copy_file(const path& from, const path& to);
+// bool copy_file(const path& from, const path& to, error_code& ec) noexcept;
+// bool copy_file(const path& from, const path& to, copy_options options);
+// bool copy_file(const path& from, const path& to, copy_options options,
+//           error_code& ec) noexcept;
+
+#include <filesystem>
+#include <cassert>
+
+#include "test_macros.h"
+#include "filesystem_test_helper.h"
+
+using namespace std::filesystem;
----------------
ldionne wrote:

Please use `namespace fs = std::filesystem` instead. We generally discourage `using namespace foo;` (I know some places in the test suite don't follow that).

https://github.com/llvm/llvm-project/pull/109211


More information about the libcxx-commits mailing list