From 89dfd9c4428018a983a216554b6e67020b368f23 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Wed, 22 Jan 2025 09:21:21 +0100 Subject: [PATCH] More evil fixes --- libcudacxx/include/cuda/std/__mdspan/extents.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libcudacxx/include/cuda/std/__mdspan/extents.h b/libcudacxx/include/cuda/std/__mdspan/extents.h index 5c1f297e049..b057cfaa72b 100644 --- a/libcudacxx/include/cuda/std/__mdspan/extents.h +++ b/libcudacxx/include/cuda/std/__mdspan/extents.h @@ -108,12 +108,27 @@ struct __possibly_empty_array<_Tp, 0> { _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp& operator[](size_t) { +# if _CCCL_COMPILER(MSVC) + return *__get_fake_ptr(); +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv _CCCL_UNREACHABLE(); +# endif // !_CCCL_COMPILER(MSVC) } _LIBCUDACXX_HIDE_FROM_ABI constexpr const _Tp& operator[](size_t) const { +# if _CCCL_COMPILER(MSVC) + return *__get_fake_ptr(); +# else // ^^^ _CCCL_COMPILER(MSVC) ^^^ / vvv !_CCCL_COMPILER(MSVC) vvv _CCCL_UNREACHABLE(); +# endif // !_CCCL_COMPILER(MSVC) } + +# if _CCCL_COMPILER(MSVC) + _CCCL_NODISCARD _LIBCUDACXX_HIDE_FROM_ABI constexpr _Tp* __get_fake_ptr() noexcept + { + return nullptr; + } +# endif // _CCCL_COMPILER(MSVC) }; // ------------------------------------------------------------------