File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -398,6 +398,15 @@ namespace stdexec {
398
398
# define STDEXEC_TERMINATE () std::terminate()
399
399
#endif
400
400
401
+ // Some compilers turn on pack indexing in pre-C++26 code. We want to use it if it is
402
+ // available. Pack indexing is disabled for clang < 20 because of:
403
+ // https://github.com/llvm/llvm-project/issues/116105
404
+ #if defined(__cpp_pack_indexing) && !STDEXEC_NVCC() && !(STDEXEC_CLANG() && __clang_major__ < 20)
405
+ # define STDEXEC_HAS_PACK_INDEXING () 1
406
+ #else // ^^^ has pack indexing ^^^ / vvv no pack indexing vvv
407
+ # define STDEXEC_HAS_PACK_INDEXING () 0
408
+ #endif // no pack indexing
409
+
401
410
#if STDEXEC_HAS_FEATURE(thread_sanitizer) || defined(__SANITIZE_THREAD__)
402
411
# define STDEXEC_TSAN (...) STDEXEC_HEAD_OR_TAIL(1 , __VA_ARGS__)
403
412
#else
Original file line number Diff line number Diff line change @@ -1025,9 +1025,10 @@ namespace stdexec {
1025
1025
using __f = __mor<__minvoke<_Fn, _Args>...>;
1026
1026
};
1027
1027
1028
- // C++23 pack indexing is disabled for clang because of
1029
- // https://github.com/llvm/llvm-project/issues/116105
1030
- #if defined(__cpp_pack_indexing) && !STDEXEC_CLANG()
1028
+ #if STDEXEC_HAS_PACK_INDEXING()
1029
+ STDEXEC_PRAGMA_PUSH ()
1030
+ STDEXEC_PRAGMA_IGNORE_GNU(" -Wc++26-extensions" )
1031
+
1031
1032
template <bool>
1032
1033
struct __m_at_ {
1033
1034
template <class _Np , class ... _Ts>
@@ -1039,6 +1040,8 @@ namespace stdexec {
1039
1040
1040
1041
template <std::size_t _Np, class ... _Ts>
1041
1042
using __m_at_c = __minvoke<__m_at_<_Np == ~0ul >, __msize_t <_Np>, _Ts...>;
1043
+
1044
+ STDEXEC_PRAGMA_POP ()
1042
1045
#elif STDEXEC_HAS_BUILTIN(__type_pack_element)
1043
1046
template <bool >
1044
1047
struct __m_at_ {
You can’t perform that action at this time.
0 commit comments