C++17, C++20 and ForcedInclude/preinclude in Visual Studio

I have two issues which can be related to the preinclusion of cuda_runtime.h (in CUDA 12.6.targets):

  1. I tried to make code navigation (F12) to libcu++ system headers work in a way that I modified the include directories from $(VC_IncludePath);$(WindowsSDK_IncludePath); to $(CudaToolkitDir)/include;$(CudaToolkitDir)/include/cuda/std;$(VC_IncludePath);$(WindowsSDK_IncludePath);. Navigation worked well, but I got various compilation error messages (like _LIBCUDACXX_HAS_NO_SPACESHIP_OPERATOR was not defined) possibly because the inclusion and macro definition order blew up in the system headers.
  2. I tried to use newer C++ features like std::to_array, std::string_view (without touching the include directories settings). I got compilation error messages and the debugging suggested that libcu headers (as part of the preinclude) included msvc headers without existing _HAS_CXX17 and _HAS_CXX20 macro definitions.

Here is what I did in the second experiment:

  1. new CUDA project is created in VS. Some example code is generated. Build was OK
  2. C++ Language support set to ISO C++20 Standard (/std:c++20). Build OK
  3. #include <array> added and const auto d = std::to_array({ 1, 2, 3, 4, 5 }); to the main function
  4. build fails with namespace “std” has no member “to_array”
  5. I added _HAS_CXX17 and _HAS_CXX20 preprocessor definitions
  6. I get ‘cudafe++’ died with status 0xC0000409 (with and without ‘Use host preprocessor definitions’)

I put this experiment here: GitHub - kondenzator/cuda_cpp20: default Visual Studio CUDA project with C++20 test code

Environment:
Visual Studio 2022 Community Edition with Nsight extension installed
CUDA Toolkit 12.6
Windows 11 x64 (version 10.0.26100.2605)
MSVC 14.40 (I tried out 14.38 as well based on CUDACOMPILE : nvcc error : 'cudafe++' died with status 0xC0000409 - #16 by Yuki_Ni)

Can you please help how can I make the new C++ features work?
Thank you your help in advance!