@@ -5850,6 +5850,8 @@ static bool hasPointerInSubobjects(const clang::CXXRecordDecl *decl) {
5850
5850
}
5851
5851
5852
5852
static bool copyConstructorIsDefaulted (const clang::CXXRecordDecl *decl) {
5853
+ llvm::dbgs () << " copy ctor is default\n " ;
5854
+
5853
5855
auto ctor = llvm::find_if (decl->ctors (), [](clang::CXXConstructorDecl *ctor) {
5854
5856
return ctor->isCopyConstructor ();
5855
5857
});
@@ -5859,6 +5861,8 @@ static bool copyConstructorIsDefaulted(const clang::CXXRecordDecl *decl) {
5859
5861
}
5860
5862
5861
5863
static bool copyAssignOperatorIsDefaulted (const clang::CXXRecordDecl *decl) {
5864
+ llvm::dbgs () << " copy assign is default\n " ;
5865
+
5862
5866
auto copyAssignOp = llvm::find_if (decl->decls (), [](clang::Decl *member) {
5863
5867
if (auto method = dyn_cast<clang::CXXMethodDecl>(member))
5864
5868
return method->isCopyAssignmentOperator ();
@@ -5880,6 +5884,8 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
5880
5884
if (!decl->getDefinition ())
5881
5885
return true ;
5882
5886
5887
+ llvm::dbgs () << " has dtor = " << (decl->getDestructor () == nullptr ? " NO" : " YES" ) << " \n " ;
5888
+
5883
5889
if ((decl->hasUserDeclaredCopyConstructor () &&
5884
5890
!copyConstructorIsDefaulted (decl)) ||
5885
5891
(decl->hasUserDeclaredCopyAssignment () &&
@@ -5888,10 +5894,15 @@ static bool isSufficientlyTrivial(const clang::CXXRecordDecl *decl) {
5888
5894
!decl->getDestructor ()->isDefaulted ()))
5889
5895
return false ;
5890
5896
5891
- auto checkType = [](clang::QualType t) {
5897
+ auto checkType = [decl](clang::QualType t) {
5898
+ PrettyStackTraceClangType trace (decl->getASTContext (), " checking subtype if sufficently trivial" , t);
5899
+
5892
5900
if (auto recordType = dyn_cast<clang::RecordType>(t.getCanonicalType ())) {
5893
5901
if (auto cxxRecord =
5894
5902
dyn_cast<clang::CXXRecordDecl>(recordType->getDecl ())) {
5903
+ clang::PrettyStackTraceDecl trace (cxxRecord, clang::SourceLocation (),
5904
+ cxxRecord->getASTContext ().getSourceManager (),
5905
+ " checking subtype recrod if sufficently trivial" );
5895
5906
if (hasImportAsRefAttr (cxxRecord) || hasOwnedValueAttr (cxxRecord) ||
5896
5907
hasUnsafeAPIAttr (cxxRecord))
5897
5908
return true ;
0 commit comments