[libcxx-commits] [libcxx] [libc++] Fix insufficiently guarded call to `copy_file_impl_fstream` (PR #214706)

Anthony Latsis via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 11 02:21:02 PDT 2026


================
@@ -362,7 +362,13 @@ bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_cod
 }
 #elif defined(_LIBCPP_FILESYSTEM_USE_FSTREAM)
 bool copy_file_impl(FileDescriptor& read_fd, FileDescriptor& write_fd, error_code& ec) {
+#  if defined(_LIBCPP_FILESYSTEM_NEED_FSTREAM)
   return copy_file_impl_fstream(read_fd, write_fd, ec);
+#  else
+  // iostreams are unavailable in the no-locale build, just fail.
----------------
AnthonyLatsis wrote:

>  It seems to me that the code path we instead want to take is `#  error "Unknown implementation for copy_file_impl"`.

I see. Makes sense.

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


More information about the libcxx-commits mailing list