[PATCH] D56411: [CUDA][HIP][Sema] Fix template kernel with function as template parameter

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 9 11:28:39 PST 2019


yaxunl added a comment.

In D56411#1349342 <https://reviews.llvm.org/D56411#1349342>, @rjmccall wrote:

> 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.


For the deferred device/host check I still need to know the template decl. I have updated the patch to pass it through ExpressionEvaluationContextRecord.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56411/new/

https://reviews.llvm.org/D56411





More information about the cfe-commits mailing list