error: the global scope has no "arg" when using Eigen in CUDA with c++20

Summary

When I include Eigen in my CUDA code, the compiler reports a lot of warnings and the error:

C:\Users\xq114\usr\include\eigen3\Eigen\src/Core/MathFunctions.h(595): error: the global scope has no "arg"
      using ::arg; ;
              ^
1 error detected in the compilation of "tests/test_init.cu".
test_init.cu

https://gitlab.com/libeigen/eigen/-/blob/master/Eigen/src/Core/MathFunctions.h#L489

It seems CUDA does not provide a device side implementation for function arg. Maybe eigen could provide an implementation or disable this function?

Environment

  • Operating System : Windows
  • Architecture : x64
  • Eigen Version : 3.4.0
  • Compiler Version : NVCC 12.2 + MSVC 17.6.4
  • Compile Flags : -O3 -m64 -rdc=true --std c++20
  • Vector Extension : None

Minimal Example

//test_init.cu
#include <Eigen/Dense>

Steps to reproduce

  1. Compile a single file with just one line including Eigen/Dense.

What is the current bug behavior?

It fails to compile.

What is the expected correct behavior?

It compiles correctly.

Relevant logs

Warning Messages

Benchmark scripts and results

Anything else that might help

I found that in pre-c++20 mode the code can be compiled. Maybe nvidia removed this function declaration when they update to c++20.