[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 08:41:29 PST 2019
yaxunl updated this revision to Diff 180848.
yaxunl added a comment.
Add test for `__host__ __device__`.
Removing the flag IsParsingTemplateArgument in Sema. Instead, check ExprEvalContexts
for disabling checking device/host consistency.
I did not use ExprEvalContext Unevaluated to condition the check because
the issue happens with ExprEvalContext ConstantEvaluated. Also we do not want to
totally remove the check, we just want to defer the check until the arg evaluation is done.
When the deferred check is performed, ExprEvalContext is still in ConstantEvaluated but
its kind is no longer EK_TemplateArgument, therefore we can use the expr kind to condition
the check.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D56411/new/
https://reviews.llvm.org/D56411
Files:
include/clang/Sema/Sema.h
lib/Sema/SemaCUDA.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaTemplate.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56411.180848.patch
Type: text/x-patch
Size: 7586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190109/439a984b/attachment.bin>
More information about the cfe-commits
mailing list