================ @@ -1131,13 +1132,18 @@ static bool isTrivialForMSVC(const CXXRecordDecl *RD, QualType Ty, return false; if (RD->hasNonTrivialCopyAssignment()) return false; + if (RD->needsImplicitCopyAssignment() && !RD->hasSimpleCopyAssignment()) ---------------- MaxEW707 wrote:
Correct. The two main cases we need to cover are the following. I'll make a comment to explain the logic. ``` struct Test { Test& operator=(const Test&) = delete; int x; }; ``` In this case `DefaultedCopyAssignmentIsDeleted` is `false` on the `CXXRecordDecl`. So we need to query `isDeleted` on the copy assignment operator `CXXMethodDecl`. ``` struct Test { int& x; }; ``` In this case we have no `CXXMethodDecl` for the copy assignment operator so we need to check if `DefaultedCopyAssignmentIsDeleted` is `true` on the `CXXRecordDecl`. https://github.com/llvm/llvm-project/pull/90547 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits