@@ -580,27 +580,27 @@ void NarrowingConversionsCheck::handleImplicitCast(
580580 switch (Cast.getCastKind ()) {
581581 case CK_BooleanToSignedIntegral:
582582 handleBooleanToSignedIntegral (Context, SourceLoc, Lhs, Rhs);
583- break ;
583+ return ;
584584 case CK_IntegralToBoolean:
585585 handleIntegralToBoolean (Context, SourceLoc, Lhs, Rhs);
586- break ;
586+ return ;
587587 case CK_IntegralToFloating:
588588 handleIntegralToFloating (Context, SourceLoc, Lhs, Rhs);
589- break ;
589+ return ;
590590 case CK_IntegralCast:
591591 handleIntegralCast (Context, SourceLoc, Lhs, Rhs);
592- break ;
592+ return ;
593593 case CK_FloatingToBoolean:
594594 handleFloatingToBoolean (Context, SourceLoc, Lhs, Rhs);
595- break ;
595+ return ;
596596 case CK_FloatingToIntegral:
597597 handleFloatingToIntegral (Context, SourceLoc, Lhs, Rhs);
598- break ;
598+ return ;
599599 case CK_FloatingCast:
600600 handleFloatingCast (Context, SourceLoc, Lhs, Rhs);
601- break ;
601+ return ;
602602 default :
603- break ;
603+ return ;
604604 }
605605}
606606
@@ -622,7 +622,6 @@ void NarrowingConversionsCheck::check(const MatchFinder::MatchResult &Result) {
622622 handleBinaryOperator (*Result.Context , *Op);
623623 else if (const auto *Cast = Result.Nodes .getNodeAs <ImplicitCastExpr>(" cast" ))
624624 handleImplicitCast (*Result.Context , *Cast);
625- else
626- llvm_unreachable (" must be binary operator or cast expression" );
625+ llvm_unreachable (" must be binary operator or cast expression" );
627626}
628627} // namespace clang::tidy::bugprone
0 commit comments