[clang] [clang][Sema] Track trivial-relocatability as a type trait (PR #84621)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 12 06:36:13 PDT 2024


================
@@ -857,8 +881,13 @@ void CXXRecordDecl::addedMember(Decl *D) {
         data().HasDeclaredCopyAssignmentWithConstParam = true;
     }
 
-    if (Method->isMoveAssignmentOperator())
+    if (Method->isMoveAssignmentOperator()) {
       SMKind |= SMF_MoveAssignment;
+    }
+
+    if (Method->isUserProvided() &&
+        (Method->isCopyAssignment() || Method->isMoveAssignment()))
+      data().IsNaturallyTriviallyRelocatable = false;
----------------
cor3ntin wrote:

If we stick to the 2786r4 definition, this is overly restrictive (ie assignment does not affect relocatability)

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


More information about the cfe-commits mailing list