Skip to content

Commit 64a6004

Browse files
committed
Pull together two similar checks into one if statement.
1 parent 4c2c535 commit 64a6004

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
@@ -921,18 +921,15 @@ void CXXRecordDecl::addedMember(Decl *D) {
921921
Method->getNonObjectParameter(0)->getType()->getAs<ReferenceType>();
922922
if (!ParamTy || ParamTy->getPointeeType().isConstQualified())
923923
data().HasDeclaredCopyAssignmentWithConstParam = true;
924-
925-
if (Method->isUserProvided())
926-
data().IsNaturallyTriviallyRelocatable = false;
927924
}
928925

929926
if (Method->isMoveAssignmentOperator()) {
930927
SMKind |= SMF_MoveAssignment;
931-
932-
if (Method->isUserProvided())
933-
data().IsNaturallyTriviallyRelocatable = false;
934928
}
935929

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

0 commit comments

Comments
 (0)