[clang] [Clang][RFC] Introduce a trait to determine the structure binding size (PR #131515)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 18 08:03:43 PDT 2025
================
@@ -1642,6 +1661,56 @@ void Sema::CheckCompleteDecompositionDeclaration(DecompositionDecl *DD) {
DD->setInvalidDecl();
}
+std::optional<unsigned> Sema::GetDecompositionElementCount(QualType T,
+ SourceLocation Loc) {
+ const ASTContext &Ctx = getASTContext();
+ assert(!T->isDependentType());
+
+ Qualifiers Quals;
+ QualType Unqual = Context.getUnqualifiedArrayType(T, Quals);
+ Quals.removeCVRQualifiers();
+ T = Context.getQualifiedType(Unqual, Quals);
----------------
AaronBallman wrote:
Why do we need to do this dance? (Should the code be moved down to above the `isTupleLike` call?)
https://github.com/llvm/llvm-project/pull/131515
More information about the cfe-commits
mailing list