File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -398,6 +398,15 @@ namespace stdexec {
398398# define STDEXEC_TERMINATE () std::terminate()
399399#endif
400400
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+
401410#if STDEXEC_HAS_FEATURE(thread_sanitizer) || defined(__SANITIZE_THREAD__)
402411# define STDEXEC_TSAN (...) STDEXEC_HEAD_OR_TAIL(1 , __VA_ARGS__)
403412#else
Original file line number Diff line number Diff line change @@ -1025,9 +1025,10 @@ namespace stdexec {
10251025 using __f = __mor<__minvoke<_Fn, _Args>...>;
10261026 };
10271027
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+
10311032 template <bool>
10321033 struct __m_at_ {
10331034 template <class _Np , class ... _Ts>
@@ -1039,6 +1040,8 @@ namespace stdexec {
10391040
10401041 template <std::size_t _Np, class ... _Ts>
10411042 using __m_at_c = __minvoke<__m_at_<_Np == ~0ul >, __msize_t <_Np>, _Ts...>;
1043+
1044+ STDEXEC_PRAGMA_POP ()
10421045#elif STDEXEC_HAS_BUILTIN(__type_pack_element)
10431046 template <bool >
10441047 struct __m_at_ {
You can’t perform that action at this time.
0 commit comments