@@ -547,7 +547,7 @@ struct CheckFallThroughDiagnostics {
547
547
unsigned diag_FallThrough_HasNoReturn = 0 ;
548
548
unsigned diag_FallThrough_ReturnsNonVoid = 0 ;
549
549
unsigned diag_NeverFallThroughOrReturn = 0 ;
550
- unsigned FunMode ; // TODO: use diag::FunModes
550
+ unsigned FunKind ; // TODO: use diag::FalloffFunctionKind
551
551
SourceLocation FuncLoc;
552
552
553
553
static CheckFallThroughDiagnostics MakeForFunction (const Decl *Func) {
@@ -570,45 +570,45 @@ struct CheckFallThroughDiagnostics {
570
570
if (!isVirtualMethod && !isTemplateInstantiation)
571
571
D.diag_NeverFallThroughOrReturn = diag::warn_suggest_noreturn_function;
572
572
573
- D.FunMode = diag::FunModes ::Function;
573
+ D.FunKind = diag::FalloffFunctionKind ::Function;
574
574
return D;
575
575
}
576
576
577
577
static CheckFallThroughDiagnostics MakeForCoroutine (const Decl *Func) {
578
578
CheckFallThroughDiagnostics D;
579
579
D.FuncLoc = Func->getLocation ();
580
580
D.diag_FallThrough_ReturnsNonVoid = diag::warn_falloff_nonvoid;
581
- D.FunMode = diag::FunModes ::Coroutine;
581
+ D.FunKind = diag::FalloffFunctionKind ::Coroutine;
582
582
return D;
583
583
}
584
584
585
585
static CheckFallThroughDiagnostics MakeForBlock () {
586
586
CheckFallThroughDiagnostics D;
587
587
D.diag_FallThrough_HasNoReturn = diag::err_noreturn_has_return_expr;
588
588
D.diag_FallThrough_ReturnsNonVoid = diag::err_falloff_nonvoid;
589
- D.FunMode = diag::FunModes ::Block;
589
+ D.FunKind = diag::FalloffFunctionKind ::Block;
590
590
return D;
591
591
}
592
592
593
593
static CheckFallThroughDiagnostics MakeForLambda () {
594
594
CheckFallThroughDiagnostics D;
595
595
D.diag_FallThrough_HasNoReturn = diag::err_noreturn_has_return_expr;
596
596
D.diag_FallThrough_ReturnsNonVoid = diag::warn_falloff_nonvoid;
597
- D.FunMode = diag::FunModes ::Lambda;
597
+ D.FunKind = diag::FalloffFunctionKind ::Lambda;
598
598
return D;
599
599
}
600
600
601
601
bool checkDiagnostics (DiagnosticsEngine &D, bool ReturnsVoid,
602
602
bool HasNoReturn) const {
603
- if (FunMode == diag::FunModes ::Function) {
603
+ if (FunKind == diag::FalloffFunctionKind ::Function) {
604
604
return (ReturnsVoid ||
605
605
D.isIgnored (diag::warn_falloff_nonvoid, FuncLoc)) &&
606
606
(!HasNoReturn ||
607
607
D.isIgnored (diag::warn_noreturn_has_return_expr, FuncLoc)) &&
608
608
(!ReturnsVoid ||
609
609
D.isIgnored (diag::warn_suggest_noreturn_block, FuncLoc));
610
610
}
611
- if (FunMode == diag::FunModes ::Coroutine) {
611
+ if (FunKind == diag::FalloffFunctionKind ::Coroutine) {
612
612
return (ReturnsVoid ||
613
613
D.isIgnored (diag::warn_falloff_nonvoid, FuncLoc)) &&
614
614
(!HasNoReturn);
@@ -673,11 +673,11 @@ static void CheckFallThroughForBody(Sema &S, const Decl *D, const Stmt *Body,
673
673
case AlwaysFallThrough:
674
674
if (HasNoReturn) {
675
675
if (CD.diag_FallThrough_HasNoReturn )
676
- S.Diag (RBrace, CD.diag_FallThrough_HasNoReturn ) << CD.FunMode ;
676
+ S.Diag (RBrace, CD.diag_FallThrough_HasNoReturn ) << CD.FunKind ;
677
677
} else if (!ReturnsVoid && CD.diag_FallThrough_ReturnsNonVoid ) {
678
678
bool NotInAllControlPaths = FallThroughType == MaybeFallThrough;
679
679
S.Diag (RBrace, CD.diag_FallThrough_ReturnsNonVoid )
680
- << CD.FunMode << NotInAllControlPaths;
680
+ << CD.FunKind << NotInAllControlPaths;
681
681
}
682
682
break ;
683
683
case NeverFallThroughOrReturn:
0 commit comments