================ @@ -5283,6 +5283,102 @@ Sema::SetDelegatingInitializer(CXXConstructorDecl *Constructor, return false; } +static void MarkFieldDestructorReferenced(Sema &S, SourceLocation Location, + FieldDecl *Field) { + if (Field->isInvalidDecl()) + return; + + // Don't destroy incomplete or zero-length arrays. + if (isIncompleteOrZeroLengthArrayType(S.Context, Field->getType())) + return; + + QualType FieldType = S.Context.getBaseElementType(Field->getType()); + + const RecordType *RT = FieldType->getAs<RecordType>(); + if (!RT) + return; + + CXXRecordDecl *FieldClassDecl = cast<CXXRecordDecl>(RT->getDecl()); ---------------- erichkeane wrote:
Instead of the `getAsRecordType` and down, we have a function for all of that. `auto *FieldType->getAsCXXRecordDecl();` https://github.com/llvm/llvm-project/pull/128866 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits