[clang] [HLSL] Convert vectors to bool for unary ! (PR #163857)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 16 14:34:48 PDT 2025
================
@@ -15944,6 +15944,20 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc,
return ExprError(Diag(OpLoc, diag::err_typecheck_unary_expr)
<< resultType << Input.get()->getSourceRange());
}
+ } else if (Context.getLangOpts().HLSL && resultType->isVectorType() &&
+ !resultType->hasBooleanRepresentation()) {
+ // HLSL unary logical not behaves like C++, which states that the
----------------
erichkeane wrote:
```suggestion
// HLSL unary logical 'not' behaves like C++, which states that the
```
https://github.com/llvm/llvm-project/pull/163857
More information about the cfe-commits
mailing list