[all-commits] [llvm/llvm-project] 0e4d23: [OpenCL] Warn about side effects for unevaluated v...
Sven van Haastregt via All-commits
all-commits at lists.llvm.org
Tue Jan 5 03:52:36 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0e4d2361b817bd16f97cd45d5792017edc3891ee
https://github.com/llvm/llvm-project/commit/0e4d2361b817bd16f97cd45d5792017edc3891ee
Author: Sven van Haastregt <sven.vanhaastregt at arm.com>
Date: 2021-01-05 (Tue, 05 Jan 2021)
Changed paths:
M clang/lib/Sema/SemaExpr.cpp
M clang/test/SemaCXX/coroutines.cpp
M clang/test/SemaOpenCL/vec_step.cl
Log Message:
-----------
[OpenCL] Warn about side effects for unevaluated vec_step arg
The argument to the `vec_step` builtin is not evaluated. Hoist the
diagnostic for this in `Sema::CheckUnaryExprOrTypeTraitOperand` such
that it comes before `Sema::CheckVecStepTraitOperandType`.
A minor side-effect of this change is that it also produces the
warning for `co_await` and `co_yield` as `sizeof` arguments now, which
seems to be reasonable given that the warning is emitted for `typeid`
already.
Differential Revision: https://reviews.llvm.org/D91348
More information about the All-commits
mailing list