The programming guide states that … all C++20 language features are supported in nvcc version 12.0 and later, subject to restrictions described here… I checked the restrictions and the C++20 concept was not mentioned, implying a full support. With that, the following code has compile error on nvcc 12.1:
// nvcc bug.cu -std=c++20
#include <type_traits>
template <typename T>
concept ReturnVoid = requires(T &t) { []<typename... Args>(void(Args...)) {}(t); };
template <auto c>
requires(ReturnVoid<std::remove_pointer_t<decltype(c)>>)
void g()
{
}
void foo(double, int){};
int main()
{
g<foo>();
return 0;
}
error: no instance of function template "g" matches the argument list
g<foo>();
There is no error, however, on gcc 11.3.0.
Is this a bug in nvcc, or did I miss anything?