[clang] [HLSL] Add __is_scalarized_layout_compatible (PR #102227)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 16 06:54:55 PDT 2024
================
@@ -6188,6 +6189,23 @@ static bool EvaluateBinaryTypeTrait(Sema &Self, TypeTrait BTT, const TypeSourceI
TSTToBeDeduced->getTemplateName().getAsTemplateDecl(), RhsT,
Info) == TemplateDeductionResult::Success;
}
+ case BTT_IsScalarizedLayoutCompatible: {
+ if (!LhsT->isVoidType() && !LhsT->isIncompleteArrayType())
+ if (Self.RequireCompleteType(Lhs->getTypeLoc().getBeginLoc(), LhsT,
+ diag::err_incomplete_type))
+ return true;
+ if (!RhsT->isVoidType() && !RhsT->isIncompleteArrayType())
+ if (Self.RequireCompleteType(Rhs->getTypeLoc().getBeginLoc(), RhsT,
+ diag::err_incomplete_type))
+ return true;
----------------
AaronBallman wrote:
```suggestion
if (!RhsT->isVoidType() && !RhsT->isIncompleteArrayType() &&
Self.RequireCompleteType(Rhs->getTypeLoc().getBeginLoc(), RhsT,
diag::err_incomplete_type))
return true;
```
https://github.com/llvm/llvm-project/pull/102227
More information about the cfe-commits
mailing list