File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -9440,7 +9440,7 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall(
9440
9440
CXXMethodDecl *Decl = SMOR.getMethod();
9441
9441
FieldDecl *Field = Subobj.dyn_cast<FieldDecl*>();
9442
9442
9443
- int DiagKind = -1 ;
9443
+ int DiagKind;
9444
9444
9445
9445
if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::NoMemberOrDeleted) {
9446
9446
if (CSM == Sema::CXXDefaultConstructor && Field &&
@@ -9451,11 +9451,10 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall(
9451
9451
// constructor and no variant member of X has a default member
9452
9452
// initializer
9453
9453
const auto *RD = cast<CXXRecordDecl>(Field->getParent());
9454
- if (!RD->hasInClassInitializer())
9455
- DiagKind = !Decl ? 0 : 1;
9456
- } else {
9457
- DiagKind = !Decl ? 0 : 1;
9454
+ if (RD->hasInClassInitializer())
9455
+ return false;
9458
9456
}
9457
+ DiagKind = !Decl ? 0 : 1;
9459
9458
} else if (SMOR.getKind() == Sema::SpecialMemberOverloadResult::Ambiguous)
9460
9459
DiagKind = 2;
9461
9460
else if (!isAccessible(Subobj, Decl))
@@ -9474,15 +9473,13 @@ bool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall(
9474
9473
// constructor and no variant member of X has a default member
9475
9474
// initializer
9476
9475
const auto *RD = cast<CXXRecordDecl>(Field->getParent());
9477
- if (!RD->hasInClassInitializer())
9478
- DiagKind = 4;
9479
- } else {
9480
- DiagKind = 4;
9476
+ if (RD->hasInClassInitializer())
9477
+ return false;
9481
9478
}
9482
- }
9483
-
9484
- if (DiagKind == -1)
9479
+ DiagKind = 4;
9480
+ } else {
9485
9481
return false;
9482
+ }
9486
9483
9487
9484
if (Diagnose) {
9488
9485
if (Field) {
You can’t perform that action at this time.
0 commit comments