CUDA 11.0.3 fails to recognize aggregate initialization in some contexts

Issue #553 resolved
Colin MacLean created an issue

nvcc was failing to compile this line:

return ::new(storage) detail::global_fnptr<Fn,detail::function_token>{detail::function_token_ss{offset}};

The compiler couldn’t find a constructor for function_token_ss, which is created with aggregate initialization. It was able to recognize the aggregate initialization of other function token types, perhaps because those have multiple members. The compiler can be tricked into recognizing the aggregate initialization by separating it into two lines:

detail::function_token_ss ss{offset};
return ::new(storage) detail::global_fnptr<Fn,detail::function_token>{std::move(ss)};

This workaround was applied with an IPR.

Comments (2)

  1. Log in to comment