diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/MisplacedWideningCastCheck.cpp')
| -rw-r--r-- | clang-tools-extra/clang-tidy/misc/MisplacedWideningCastCheck.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/MisplacedWideningCastCheck.cpp b/clang-tools-extra/clang-tidy/misc/MisplacedWideningCastCheck.cpp index 101c0a1267d..7919258e650 100644 --- a/clang-tools-extra/clang-tidy/misc/MisplacedWideningCastCheck.cpp +++ b/clang-tools-extra/clang-tidy/misc/MisplacedWideningCastCheck.cpp @@ -37,10 +37,11 @@ void MisplacedWideningCastCheck::registerMatchers(MatchFinder *Finder) { hasType(isInteger())) .bind("Calc"); - const auto ExplicitCast = - explicitCastExpr(hasDestinationType(isInteger()), has(Calc)); + const auto ExplicitCast = explicitCastExpr(hasDestinationType(isInteger()), + has(ignoringParenImpCasts(Calc))); const auto ImplicitCast = - implicitCastExpr(hasImplicitDestinationType(isInteger()), has(Calc)); + implicitCastExpr(hasImplicitDestinationType(isInteger()), + has(ignoringParenImpCasts(Calc))); const auto Cast = expr(anyOf(ExplicitCast, ImplicitCast)).bind("Cast"); Finder->addMatcher(varDecl(hasInitializer(Cast)), this); |

