[libcxx-commits] [libcxx] [libcxx] Handle windows system error code mapping in std::error_code. (PR #93101)

James Y Knight via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 13 15:38:49 PDT 2024


================
@@ -22,7 +22,9 @@
 #include <__filesystem/path.h>
 #include <__filesystem/perms.h>
 #include <__system_error/errc.h>
+#include <__system_error/error_category.h>
 #include <__system_error/error_code.h>
+#include <__system_error/error_condition.h>
----------------
jyknight wrote:

OK, now I remember why. :) Modules build is broken without.

```
While building module 'std_fstream' imported from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx26/test/libcxx/clang_modules_include.gen.py/fstream.compile.pass.cpp:19:
While building module 'std_filesystem' imported from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx26/libcxx/test-suite-install/include/c++/v1/fstream:201:
In file included from <module-includes>:1:
In file included from /home/runner/_work/llvm-project/llvm-project/build/generic-cxx26/libcxx/test-suite-install/include/c++/v1/filesystem:540:
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx26/libcxx/test-suite-install/include/c++/v1/__filesystem/directory_entry.h:277:26: error: invalid operands to binary expression ('const error_code' and 'std::errc')
  277 |     return !__ec || __ec == errc::no_such_file_or_directory || __ec == errc::not_a_directory;
      |                     ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[...]
/home/runner/_work/llvm-project/llvm-project/build/generic-cxx26/libcxx/test-suite-install/include/c++/v1/__system_error/error_code.h:96:35: note: candidate function not viable: no known conversion from 'std::errc' to 'const error_condition' for 2nd argument
   96 | inline _LIBCPP_HIDE_FROM_ABI bool operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT {
      |                                   ^                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
```


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


More information about the libcxx-commits mailing list