CUDA C++20标准下foo函数编译失败问题咨询
CUDA C++20下模板函数编译异常问题
以下代码在CUDA C++20标准环境中编译失败,报错信息如下:
:1:20: error: expected identifier before '>' token 1 | template | ^
观察代码表现:
foo函数编译失败bar和baz函数可正常编译- 相同的
foo代码在GCC编译器下能正常通过编译,推测这可能是CUDA编译器的Bug。
相关代码如下:
template <typename T> void foo(T& arg0, auto arg1) { auto func = []<typename S>(S arg){}; } template <typename T> void bar(T& arg0) { auto func = []<typename S>(S arg){}; } template <typename T> void baz(T& arg0, auto arg1) { }
内容的提问来源于stack exchange,提问作者Saitama10000
相关产品推荐
相关产品推荐

