From 2ba9597c24ef1fd8ae25588f8172b7be715660a3 Mon Sep 17 00:00:00 2001 From: Wesley Maxey <71408887+wmaxey@users.noreply.github.com> Date: Mon, 14 Oct 2024 13:58:05 -0700 Subject: [PATCH] Block type pack indexing on NVCC (#2563) * Block type indexing if the compiler is NVCC. Co-authored-by: Michael Schellenberger Costa --- libcudacxx/include/cuda/std/__type_traits/type_list.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libcudacxx/include/cuda/std/__type_traits/type_list.h b/libcudacxx/include/cuda/std/__type_traits/type_list.h index 0be25bf6a3e..96357ff2674 100644 --- a/libcudacxx/include/cuda/std/__type_traits/type_list.h +++ b/libcudacxx/include/cuda/std/__type_traits/type_list.h @@ -258,7 +258,10 @@ struct _CCCL_TYPE_VISIBILITY_DEFAULT __type_defer {}; // Implementation for indexing into a list of types: -# if defined(__cpp_pack_indexing) +# if defined(__cpp_pack_indexing) && !defined(_CCCL_CUDA_COMPILER_NVCC) + +_CCCL_DIAG_PUSH +_CCCL_DIAG_SUPPRESS_CLANG("-Wc++26-extensions") template using __type_index_c = _Ts...[_Ip]; @@ -266,6 +269,8 @@ using __type_index_c = _Ts...[_Ip]; template using __type_index = _Ts...[_Ip::value]; +_CCCL_DIAG_POP + // Versions of nvcc prior to 12.0 have trouble with pack expansion into // __type_pack_element in an alias template, so we use the fall-back // implementation instead.