Skip to content

Commit a7ff71d

Browse files
committed
Pull together two similar checks into one if statement.
1 parent 6e127e5 commit a7ff71d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

clang/lib/AST/DeclCXX.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -879,18 +879,15 @@ void CXXRecordDecl::addedMember(Decl *D) {
879879
Method->getNonObjectParameter(0)->getType()->getAs<ReferenceType>();
880880
if (!ParamTy || ParamTy->getPointeeType().isConstQualified())
881881
data().HasDeclaredCopyAssignmentWithConstParam = true;
882-
883-
if (Method->isUserProvided())
884-
data().IsNaturallyTriviallyRelocatable = false;
885882
}
886883

887884
if (Method->isMoveAssignmentOperator()) {
888885
SMKind |= SMF_MoveAssignment;
889-
890-
if (Method->isUserProvided())
891-
data().IsNaturallyTriviallyRelocatable = false;
892886
}
893887

888+
if (Method->isUserProvided() && (Method->isCopyAssignment() || Method->isMoveAssignment()))
889+
data().IsNaturallyTriviallyRelocatable = false;
890+
894891
// Keep the list of conversion functions up-to-date.
895892
if (auto *Conversion = dyn_cast<CXXConversionDecl>(D)) {
896893
// FIXME: We use the 'unsafe' accessor for the access specifier here,

0 commit comments

Comments
 (0)