[clang] [HLSL] Desugar ConstantArrayType when calculating cbuffer field layout (PR #134683)
Helena Kotas via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 7 10:56:28 PDT 2025
================
@@ -195,7 +195,8 @@ bool HLSLBufferLayoutBuilder::layoutField(const FieldDecl *FD,
// Unwrap array to find the element type and get combined array size.
QualType Ty = FieldTy;
while (Ty->isConstantArrayType()) {
- const ConstantArrayType *ArrayTy = cast<ConstantArrayType>(Ty);
+ const ConstantArrayType *ArrayTy =
+ cast<ConstantArrayType>(Ty.getDesugaredType(CGM.getContext()));
----------------
hekota wrote:
```suggestion
cast<ConstantArrayType>(Ty->getUnqualifiedDesugaredType());
```
https://github.com/llvm/llvm-project/pull/134683
More information about the cfe-commits
mailing list