[libcxx-commits] [libcxx] [libcxx] Add a missing include for __enable_if_t (PR #127016)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Feb 12 23:19:26 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Takuto Ikuta (atetubou)

<details>
<summary>Changes</summary>

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;
      | ^
```

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


1 Files Affected:

- (modified) libcxx/include/__filesystem/path.h (+1) 


``````````diff
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>

``````````

</details>


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


More information about the libcxx-commits mailing list