[PATCH] D61458: [hip] Relax CUDA call restriction within `decltype` context.
Michael Liao via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 2 13:50:01 PDT 2019
hliao marked an inline comment as done.
hliao added a comment.
In D61458#1488523 <https://reviews.llvm.org/D61458#1488523>, @tra wrote:
> Perhaps we should allow this in all unevaluated contexts?
> I.e. `int s = sizeof(foo(x));` should also work.
good point, do we have a dedicated context for sizeof? that make the checking easier.
================
Comment at: clang/include/clang/Sema/Sema.h:10411
+ auto I =
+ std::find_if(ExprEvalContexts.rbegin(), ExprEvalContexts.rend(),
+ [](const ExpressionEvaluationContextRecord &C) {
----------------
tra wrote:
> I think you want `return llvm::any_of(ExprEvalContexts, ...)` here and you can fold it directly into `if()` below.
yeah, that's much simpler, I will make the change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61458/new/
https://reviews.llvm.org/D61458
More information about the cfe-commits
mailing list