@@ -89,45 +89,45 @@ void BoolBitwiseOperationCheck::check(const MatchFinder::MatchResult &Result) {
8989 return E->IgnoreImpCasts ()->getType ().isVolatileQualified ();
9090 });
9191 if (HasVolatileOperand)
92- return ( void ) DiagEmitter ();
92+ return static_cast < void >( DiagEmitter () );
9393
9494 const bool HasSideEffects = MatchedExpr->getRHS ()->HasSideEffects (
9595 *Result.Context , /* IncludePossibleEffects=*/ !StrictMode);
9696 if (HasSideEffects)
97- return ( void ) DiagEmitter ();
97+ return static_cast < void >( DiagEmitter () );
9898
9999 SourceLocation Loc = MatchedExpr->getOperatorLoc ();
100100
101101 if (Loc.isInvalid () || Loc.isMacroID ())
102- return void (IgnoreMacros || DiagEmitter ());
102+ return static_cast < void > (IgnoreMacros || DiagEmitter ());
103103
104104 Loc = Result.SourceManager ->getSpellingLoc (Loc);
105105 if (Loc.isInvalid () || Loc.isMacroID ())
106- return void (IgnoreMacros || DiagEmitter ());
106+ return static_cast < void > (IgnoreMacros || DiagEmitter ());
107107
108108 const CharSourceRange TokenRange = CharSourceRange::getTokenRange (Loc);
109109 if (TokenRange.isInvalid ())
110- return void (IgnoreMacros || DiagEmitter ());
110+ return static_cast < void > (IgnoreMacros || DiagEmitter ());
111111
112112 const StringRef FixSpelling = translate (Lexer::getSourceText (
113113 TokenRange, *Result.SourceManager , Result.Context ->getLangOpts ()));
114114
115115 if (FixSpelling.empty ())
116- return ( void ) DiagEmitter ();
116+ return static_cast < void >( DiagEmitter () );
117117
118118 FixItHint InsertEqual;
119119 if (MatchedExpr->isCompoundAssignmentOp ()) {
120120 const auto *DeclRefLHS =
121121 dyn_cast<DeclRefExpr>(MatchedExpr->getLHS ()->IgnoreImpCasts ());
122122 if (!DeclRefLHS)
123- return ( void ) DiagEmitter ();
123+ return static_cast < void >( DiagEmitter () );
124124 const SourceLocation LocLHS = DeclRefLHS->getEndLoc ();
125125 if (LocLHS.isInvalid () || LocLHS.isMacroID ())
126- return void (IgnoreMacros || DiagEmitter ());
126+ return static_cast < void > (IgnoreMacros || DiagEmitter ());
127127 const SourceLocation InsertLoc = clang::Lexer::getLocForEndOfToken (
128128 LocLHS, 0 , *Result.SourceManager , Result.Context ->getLangOpts ());
129129 if (InsertLoc.isInvalid () || InsertLoc.isMacroID ())
130- return void (IgnoreMacros || DiagEmitter ());
130+ return static_cast < void > (IgnoreMacros || DiagEmitter ());
131131 InsertEqual = FixItHint::CreateInsertion (
132132 InsertLoc, " = " + DeclRefLHS->getDecl ()->getNameAsString ());
133133 }
@@ -149,7 +149,7 @@ void BoolBitwiseOperationCheck::check(const MatchFinder::MatchResult &Result) {
149149 if ((MatchedExpr->getOpcode () == BO_Or && ParentOpcode == BO_LAnd) ||
150150 (MatchedExpr->getOpcode () == BO_And &&
151151 llvm::is_contained ({BO_Xor, BO_Or}, ParentOpcode))) {
152- const auto *Side = Parent->getLHS ()->IgnoreParenImpCasts () == MatchedExpr
152+ const Expr *Side = Parent->getLHS ()->IgnoreParenImpCasts () == MatchedExpr
153153 ? Parent->getLHS ()
154154 : Parent->getRHS ();
155155 SurroundedExpr = Side->IgnoreImpCasts ();
@@ -160,15 +160,16 @@ void BoolBitwiseOperationCheck::check(const MatchFinder::MatchResult &Result) {
160160 if (SurroundedExpr && isa<ParenExpr>(SurroundedExpr))
161161 SurroundedExpr = nullptr ;
162162
163- FixItHint InsertBrace1, InsertBrace2;
163+ FixItHint InsertBrace1;
164+ FixItHint InsertBrace2;
164165 if (SurroundedExpr) {
165166 const SourceLocation InsertFirstLoc = SurroundedExpr->getBeginLoc ();
166167 const SourceLocation InsertSecondLoc = clang::Lexer::getLocForEndOfToken (
167168 SurroundedExpr->getEndLoc (), 0 , *Result.SourceManager ,
168169 Result.Context ->getLangOpts ());
169170 if (InsertFirstLoc.isInvalid () || InsertFirstLoc.isMacroID () ||
170171 InsertSecondLoc.isInvalid () || InsertSecondLoc.isMacroID ())
171- return void (IgnoreMacros || DiagEmitter ());
172+ return static_cast < void > (IgnoreMacros || DiagEmitter ());
172173 InsertBrace1 = FixItHint::CreateInsertion (InsertFirstLoc, " (" );
173174 InsertBrace2 = FixItHint::CreateInsertion (InsertSecondLoc, " )" );
174175 }
0 commit comments