[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


================
@@ -1475,6 +1475,48 @@ static DeclAccessPair findDecomposableBaseClass(Sema &S, SourceLocation Loc,
   return DeclAccessPair::make(const_cast<CXXRecordDecl*>(ClassWithFields), AS);
 }
 
+static bool CheckMemberDecompositionFields(Sema &S, SourceLocation Loc,
+                                           const CXXRecordDecl *OrigRD,
+                                           QualType DecompType,
+                                           DeclAccessPair BasePair) {
+  const CXXRecordDecl *RD = cast_or_null<CXXRecordDecl>(BasePair.getDecl());
----------------
AaronBallman wrote:

```suggestion
  const auto *RD = cast_or_null<CXXRecordDecl>(BasePair.getDecl());
```

https://github.com/llvm/llvm-project/pull/131515


More information about the cfe-commits mailing list