[PATCH] D56411: [CUDA][HIP][Sema] Fix template kernel with function as template parameter
John McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 7 23:45:03 PST 2019
rjmccall added a comment.
Sema won't necessarily have resolved a template decl when parsing a template argument list, so trying to propagate that decl down to indicate that we're resolving a template argument is not a good approach.
I was going to suggest recording that we're within a template argument in the current `ExpressionEvaluationContextRecord`, but in fact there's an even simpler and more general solution: there's no reason to enforce this restriction in *any* unevaluated context. If someone wants to refer to a device function within a `decltype` or `sizeof` operand, that should be fine. So you should just conditionalize the diagnostic on whether this is within an unevaluated context.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56411/new/
https://reviews.llvm.org/D56411
More information about the cfe-commits
mailing list