Skip to content

Conversation

@atetubou
Copy link
Contributor

This is to fix compile error with explicit Clang modules like

../../third_party/libc++/src/include/__filesystem/path.h:80:26: error: declaration of '__enable_if_t' must be imported from module 'std_core.type_traits.enable_if' before it is required
   80 | template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
      |                          ^
../../third_party/libc++/src/include/__type_traits/enable_if.h:34:1: note: declaration here is not visible
   34 | using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
      | ^

This is to fix compile error with explicit Clang modules like
```
../../third_party/libc++/src/include/__filesystem/path.h:80:26: error: declaration of '__enable_if_t' must be imported from module 'std_core.type_traits.enable_if' before it is required
   80 | template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
      |                          ^
../../third_party/libc++/src/include/__type_traits/enable_if.h:34:1: note: declaration here is not visible
   34 | using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
      | ^
```
@atetubou atetubou requested a review from a team as a code owner February 13, 2025 07:18
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Feb 13, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 13, 2025

@llvm/pr-subscribers-libcxx

Author: Takuto Ikuta (atetubou)

Changes

This is to fix compile error with explicit Clang modules like

../../third_party/libc++/src/include/__filesystem/path.h:80:26: error: declaration of '__enable_if_t' must be imported from module 'std_core.type_traits.enable_if' before it is required
   80 | template &lt;class _ECharT, __enable_if_t&lt;__can_convert_char&lt;_ECharT&gt;::value, int&gt; = 0&gt;
      |                          ^
../../third_party/libc++/src/include/__type_traits/enable_if.h:34:1: note: declaration here is not visible
   34 | using __enable_if_t _LIBCPP_NODEBUG = typename enable_if&lt;_Bp, _Tp&gt;::type;
      | ^

Full diff: https://github.com/llvm/llvm-project/pull/127016.diff

1 Files Affected:

  • (modified) libcxx/include/__filesystem/path.h (+1)
diff --git a/libcxx/include/__filesystem/path.h b/libcxx/include/__filesystem/path.h
index 0a751ba32954f..698ae209ae1f8 100644
--- a/libcxx/include/__filesystem/path.h
+++ b/libcxx/include/__filesystem/path.h
@@ -18,6 +18,7 @@
 #include <__iterator/back_insert_iterator.h>
 #include <__iterator/iterator_traits.h>
 #include <__type_traits/decay.h>
+#include <__type_traits/enable_if.h>
 #include <__type_traits/is_pointer.h>
 #include <__type_traits/remove_const.h>
 #include <__type_traits/remove_pointer.h>

@var-const var-const merged commit 0761841 into llvm:main Feb 13, 2025
41 of 48 checks passed
@atetubou atetubou deleted the patch-3 branch February 13, 2025 07:56
flovent pushed a commit to flovent/llvm-project that referenced this pull request Feb 13, 2025
This is to fix compile error with explicit Clang modules like
```
../../third_party/libc++/src/include/__filesystem/path.h:80:26: error: declaration of '__enable_if_t' must be imported from module 'std_core.type_traits.enable_if' before it is required
   80 | template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
      |                          ^
../../third_party/libc++/src/include/__type_traits/enable_if.h:34:1: note: declaration here is not visible
   34 | using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
      | ^
```
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
This is to fix compile error with explicit Clang modules like
```
../../third_party/libc++/src/include/__filesystem/path.h:80:26: error: declaration of '__enable_if_t' must be imported from module 'std_core.type_traits.enable_if' before it is required
   80 | template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
      |                          ^
../../third_party/libc++/src/include/__type_traits/enable_if.h:34:1: note: declaration here is not visible
   34 | using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
      | ^
```
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
This is to fix compile error with explicit Clang modules like
```
../../third_party/libc++/src/include/__filesystem/path.h:80:26: error: declaration of '__enable_if_t' must be imported from module 'std_core.type_traits.enable_if' before it is required
   80 | template <class _ECharT, __enable_if_t<__can_convert_char<_ECharT>::value, int> = 0>
      |                          ^
../../third_party/libc++/src/include/__type_traits/enable_if.h:34:1: note: declaration here is not visible
   34 | using __enable_if_t _LIBCPP_NODEBUG = typename enable_if<_Bp, _Tp>::type;
      | ^
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants