[libcxx-commits] [libcxx] [libcxx] Add a missing include for __enable_if_t (PR #127016)
Takuto Ikuta via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 12 23:18:52 PST 2025
https://github.com/atetubou created https://github.com/llvm/llvm-project/pull/127016
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;
| ^
```
>From f618a0362d276a60d8cf02429526c95accfdd9cf Mon Sep 17 00:00:00 2001
From: Takuto Ikuta <tikuta at google.com>
Date: Thu, 13 Feb 2025 16:18:31 +0900
Subject: [PATCH] [libcxx] Add a missing include for __enable_if_t
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;
| ^
```
---
libcxx/include/__filesystem/path.h | 1 +
1 file changed, 1 insertion(+)
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>
More information about the libcxx-commits
mailing list