steveire created this revision.
steveire added a reviewer: aaron.ballman.
Herald added subscribers: cfe-commits, arphaman, kbarton, nemanjai.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80499

Files:
  clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp
  clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp
  clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp
  clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
  clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
  clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
  
clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp
  clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
  
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
  
clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
  clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
  clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
  clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp
  clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
  clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
  clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
  clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
  clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
  clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
  
clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
  clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
  clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
  clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
  clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
  clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
  clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
  clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp

Index: clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/UniqueptrDeleteReleaseCheck.cpp
@@ -27,11 +27,11 @@
                                  hasName("std::default_delete")))))));
 
   Finder->addMatcher(
-      cxxDeleteExpr(has(ignoringParenImpCasts(cxxMemberCallExpr(
-                        on(expr(hasType(UniquePtrWithDefaultDelete),
-                                unless(hasType(IsSusbstituted)))
-                               .bind("uptr")),
-                        callee(cxxMethodDecl(hasName("release")))))))
+      cxxDeleteExpr(
+          has(cxxMemberCallExpr(on(expr(hasType(UniquePtrWithDefaultDelete),
+                                        unless(hasType(IsSusbstituted)))
+                                       .bind("uptr")),
+                                callee(cxxMethodDecl(hasName("release"))))))
           .bind("delete"),
       this);
 }
Index: clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/SimplifySubscriptExprCheck.cpp
@@ -32,7 +32,7 @@
           llvm::SmallVector<StringRef, 8>(Types.begin(), Types.end()))))));
 
   Finder->addMatcher(
-      arraySubscriptExpr(hasBase(ignoringParenImpCasts(
+      arraySubscriptExpr(hasBase(
           cxxMemberCallExpr(
               has(memberExpr().bind("member")),
               on(hasType(qualType(
@@ -40,7 +40,7 @@
                                hasDescendant(substTemplateTypeParmType()))),
                   anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)))))),
               callee(namedDecl(hasName("data"))))
-              .bind("call")))),
+              .bind("call"))),
       this);
 }
 
Index: clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
@@ -489,8 +489,7 @@
       compoundStmt(
           hasAnySubstatement(
               ifStmt(hasThen(returnsBool(Value)), unless(hasElse(stmt())))),
-          hasAnySubstatement(returnStmt(has(ignoringParenImpCasts(
-                                            cxxBoolLiteral(equals(!Value)))))
+          hasAnySubstatement(returnStmt(has(cxxBoolLiteral(equals(!Value))))
                                  .bind(CompoundReturnId)))
           .bind(Id),
       this);
Index: clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/RedundantSmartptrGetCheck.cpp
@@ -47,10 +47,9 @@
   const auto Smartptr = anyOf(knownSmartptr(), QuacksLikeASmartptr);
 
   // Catch 'ptr.get()->Foo()'
-  Finder->addMatcher(
-      memberExpr(expr().bind("memberExpr"), isArrow(),
-                 hasObjectExpression(ignoringImpCasts(callToGet(Smartptr)))),
-      Callback);
+  Finder->addMatcher(memberExpr(expr().bind("memberExpr"), isArrow(),
+                                hasObjectExpression(callToGet(Smartptr))),
+                     Callback);
 
   // Catch '*ptr.get()' or '*ptr->get()'
   Finder->addMatcher(
@@ -58,8 +57,8 @@
       Callback);
 
   // Catch '!ptr.get()'
-  const auto CallToGetAsBool = ignoringParenImpCasts(callToGet(
-      recordDecl(Smartptr, has(cxxConversionDecl(returns(booleanType()))))));
+  const auto CallToGetAsBool = callToGet(
+      recordDecl(Smartptr, has(cxxConversionDecl(returns(booleanType())))));
   Finder->addMatcher(
       unaryOperator(hasOperatorName("!"), hasUnaryOperand(CallToGetAsBool)),
       Callback);
@@ -82,9 +81,8 @@
   // Matches against nullptr.
   Finder->addMatcher(
       binaryOperator(hasAnyOperatorName("==", "!="),
-                     hasOperands(ignoringImpCasts(anyOf(
-                                     cxxNullPtrLiteralExpr(), gnuNullExpr(),
-                                     integerLiteral(equals(0)))),
+                     hasOperands(anyOf(cxxNullPtrLiteralExpr(), gnuNullExpr(),
+                                       integerLiteral(equals(0))),
                                  callToGet(knownSmartptr()))),
       Callback);
 
Index: clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
@@ -146,8 +146,7 @@
 void ElseAfterReturnCheck::registerMatchers(MatchFinder *Finder) {
   const auto InterruptsControlFlow =
       stmt(anyOf(returnStmt().bind(ReturnStr), continueStmt().bind(ContinueStr),
-                 breakStmt().bind(BreakStr),
-                 expr(ignoringImplicit(cxxThrowExpr().bind(ThrowStr)))));
+                 breakStmt().bind(BreakStr), cxxThrowExpr().bind(ThrowStr)));
   Finder->addMatcher(
       compoundStmt(
           forEach(ifStmt(unless(isConstexpr()),
Index: clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
@@ -69,15 +69,12 @@
           hasDeclaration(cxxConstructorDecl(isDefaultConstructor())));
   // Comparison to empty string or empty constructor.
   const auto WrongComparend = anyOf(
-      ignoringImpCasts(stringLiteral(hasSize(0))),
-      ignoringImpCasts(cxxBindTemporaryExpr(has(DefaultConstructor))),
-      ignoringImplicit(DefaultConstructor),
-      cxxConstructExpr(
-          hasDeclaration(cxxConstructorDecl(isCopyConstructor())),
-          has(expr(ignoringImpCasts(DefaultConstructor)))),
-      cxxConstructExpr(
-          hasDeclaration(cxxConstructorDecl(isMoveConstructor())),
-          has(expr(ignoringImpCasts(DefaultConstructor)))));
+      stringLiteral(hasSize(0)), cxxBindTemporaryExpr(has(DefaultConstructor)),
+      DefaultConstructor,
+      cxxConstructExpr(hasDeclaration(cxxConstructorDecl(isCopyConstructor())),
+                       has(DefaultConstructor)),
+      cxxConstructExpr(hasDeclaration(cxxConstructorDecl(isMoveConstructor())),
+                       has(DefaultConstructor)));
   // Match the object being compared.
   const auto STLArg =
       anyOf(unaryOperator(
Index: clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
+++ clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp
@@ -102,12 +102,12 @@
           callee(AppendMethodDecl), on(hasType(TargetRecordDecl)),
           onImplicitObjectArgument(declRefExpr(to(TargetVarDecl))))
           .bind(AppendCallName);
-  const auto AppendCall = expr(ignoringImplicit(AppendCallExpr));
+  const auto AppendCall = AppendCallExpr;
   const auto LoopVarInit =
       declStmt(hasSingleDecl(varDecl(hasInitializer(integerLiteral(equals(0))))
                                  .bind(LoopInitVarName)));
-  const auto RefersToLoopVar = ignoringParenImpCasts(
-      declRefExpr(to(varDecl(equalsBoundNode(LoopInitVarName)))));
+  const auto RefersToLoopVar =
+      declRefExpr(to(varDecl(equalsBoundNode(LoopInitVarName))));
 
   // Matchers for the loop whose body has only 1 push_back/emplace_back calling
   // statement.
Index: clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
+++ clang-tools-extra/clang-tidy/performance/InefficientStringConcatenationCheck.cpp
@@ -32,15 +32,14 @@
       hasType(qualType(hasUnqualifiedDesugaredType(recordType(
           hasDeclaration(cxxRecordDecl(hasName("::std::basic_string")))))));
 
-  const auto BasicStringPlusOperator = cxxOperatorCallExpr(
-      hasOverloadedOperatorName("+"),
-      hasAnyArgument(ignoringImpCasts(declRefExpr(BasicStringType))));
+  const auto BasicStringPlusOperator =
+      cxxOperatorCallExpr(hasOverloadedOperatorName("+"),
+                          hasAnyArgument(declRefExpr(BasicStringType)));
 
   const auto PlusOperator =
-      cxxOperatorCallExpr(
-          hasOverloadedOperatorName("+"),
-          hasAnyArgument(ignoringImpCasts(declRefExpr(BasicStringType))),
-          hasDescendant(BasicStringPlusOperator))
+      cxxOperatorCallExpr(hasOverloadedOperatorName("+"),
+                          hasAnyArgument(declRefExpr(BasicStringType)),
+                          hasDescendant(BasicStringPlusOperator))
           .bind("plusOperator");
 
   const auto AssignOperator = cxxOperatorCallExpr(
@@ -48,8 +47,8 @@
       hasArgument(0, declRefExpr(BasicStringType,
                                  hasDeclaration(decl().bind("lhsStrT")))
                          .bind("lhsStr")),
-      hasArgument(1, stmt(hasDescendant(declRefExpr(
-                         hasDeclaration(decl(equalsBoundNode("lhsStrT"))))))),
+      hasArgument(1, hasDescendant(declRefExpr(
+                         hasDeclaration(decl(equalsBoundNode("lhsStrT")))))),
       hasDescendant(BasicStringPlusOperator));
 
   if (StrictMode) {
Index: clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
+++ clang-tools-extra/clang-tidy/performance/FasterStringFindCheck.cpp
@@ -62,8 +62,7 @@
   if (!getLangOpts().CPlusPlus)
     return;
 
-  const auto SingleChar =
-      expr(ignoringParenCasts(stringLiteral(hasSize(1)).bind("literal")));
+  const auto SingleChar = stringLiteral(hasSize(1)).bind("literal");
   const auto StringFindFunctions =
       hasAnyName("find", "rfind", "find_first_of", "find_first_not_of",
                  "find_last_of", "find_last_not_of");
Index: clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
+++ clang-tools-extra/clang-tidy/modernize/UseUncaughtExceptionsCheck.cpp
@@ -31,8 +31,8 @@
           .bind("decl_ref_expr"),
       this);
 
-  auto DirectCallToUncaughtException = callee(expr(ignoringImpCasts(
-      declRefExpr(hasDeclaration(functionDecl(hasName(MatchText)))))));
+  auto DirectCallToUncaughtException =
+      callee(declRefExpr(hasDeclaration(functionDecl(hasName(MatchText)))));
 
   // CallExpr: warning, fix-it.
   Finder->addMatcher(callExpr(DirectCallToUncaughtException,
Index: clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
+++ clang-tools-extra/clang-tidy/modernize/UseDefaultMemberInitCheck.cpp
@@ -207,9 +207,8 @@
             declRefExpr(to(enumConstantDecl())));
 
   auto Init =
-      anyOf(initListExpr(anyOf(
-                allOf(initCountIs(1), hasInit(0, ignoringImplicit(InitBase))),
-                initCountIs(0))),
+      anyOf(initListExpr(anyOf(allOf(initCountIs(1), hasInit(0, InitBase)),
+                               initCountIs(0))),
             InitBase);
 
   Finder->addMatcher(
@@ -222,7 +221,7 @@
                                             : isBitField(),
                                         hasInClassInitializer(anything()),
                                         hasParent(recordDecl(isUnion()))))),
-                  isWritten(), withInitializer(ignoringImplicit(Init)))
+                  isWritten(), withInitializer(Init))
                   .bind("default"))),
       this);
 
@@ -231,8 +230,7 @@
           unless(ast_matchers::isTemplateInstantiation()),
           forEachConstructorInitializer(
               cxxCtorInitializer(forField(hasInClassInitializer(anything())),
-                                 isWritten(),
-                                 withInitializer(ignoringImplicit(Init)))
+                                 isWritten(), withInitializer(Init))
                   .bind("existing"))),
       this);
 }
Index: clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
+++ clang-tools-extra/clang-tidy/misc/UniqueptrResetReleaseCheck.cpp
@@ -24,13 +24,13 @@
               cxxMethodDecl(hasName("reset"),
                             ofClass(cxxRecordDecl(hasName("::std::unique_ptr"),
                                                   decl().bind("left_class"))))),
-          has(ignoringParenImpCasts(cxxMemberCallExpr(
+          has(cxxMemberCallExpr(
               on(expr().bind("right")),
               callee(memberExpr().bind("release_member")),
               callee(cxxMethodDecl(
                   hasName("release"),
                   ofClass(cxxRecordDecl(hasName("::std::unique_ptr"),
-                                        decl().bind("right_class")))))))))
+                                        decl().bind("right_class"))))))))
           .bind("reset_call"),
       this);
 }
Index: clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
+++ clang-tools-extra/clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp
@@ -51,16 +51,14 @@
       cxxMethodDecl(IsSelfAssign, anyOf(isConst(), isVirtual())).bind("cv"),
       this);
 
-  const auto IsBadReturnStatement = returnStmt(unless(has(ignoringParenImpCasts(
-      anyOf(unaryOperator(hasOperatorName("*"), hasUnaryOperand(cxxThisExpr())),
-            cxxOperatorCallExpr(argumentCountIs(1),
-                                callee(unresolvedLookupExpr()),
-                                hasArgument(0, cxxThisExpr())),
-            cxxOperatorCallExpr(
-                hasOverloadedOperatorName("="),
-                hasArgument(
-                    0, unaryOperator(hasOperatorName("*"),
-                                     hasUnaryOperand(cxxThisExpr())))))))));
+  const auto IsBadReturnStatement = returnStmt(unless(has(stmt(anyOf(
+      unaryOperator(hasOperatorName("*"), hasUnaryOperand(cxxThisExpr())),
+      cxxOperatorCallExpr(argumentCountIs(1), callee(unresolvedLookupExpr()),
+                          hasArgument(0, cxxThisExpr())),
+      cxxOperatorCallExpr(
+          hasOverloadedOperatorName("="),
+          hasArgument(0, unaryOperator(hasOperatorName("*"),
+                                       hasUnaryOperand(cxxThisExpr())))))))));
   const auto IsGoodAssign = cxxMethodDecl(IsAssign, HasGoodReturnType);
 
   Finder->addMatcher(returnStmt(IsBadReturnStatement, forFunction(IsGoodAssign))
Index: clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
+++ clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
@@ -27,37 +27,33 @@
     : ClangTidyCheck(Name, Context) {}
 
 void StaticAssertCheck::registerMatchers(MatchFinder *Finder) {
-  auto NegatedString = unaryOperator(
-      hasOperatorName("!"), hasUnaryOperand(ignoringImpCasts(stringLiteral())));
+  auto NegatedString =
+      unaryOperator(hasOperatorName("!"), hasUnaryOperand(stringLiteral()));
   auto IsAlwaysFalse =
       expr(anyOf(cxxBoolLiteral(equals(false)), integerLiteral(equals(0)),
                  cxxNullPtrLiteralExpr(), gnuNullExpr(), NegatedString))
           .bind("isAlwaysFalse");
-  auto IsAlwaysFalseWithCast = ignoringParenImpCasts(anyOf(
-      IsAlwaysFalse, cStyleCastExpr(has(ignoringParenImpCasts(IsAlwaysFalse)))
-                         .bind("castExpr")));
-  auto AssertExprRoot = anyOf(
-      binaryOperator(
-          hasAnyOperatorName("&&", "=="),
-          hasEitherOperand(ignoringImpCasts(stringLiteral().bind("assertMSG"))),
-          anyOf(binaryOperator(hasEitherOperand(IsAlwaysFalseWithCast)),
-                anything()))
-          .bind("assertExprRoot"),
-      IsAlwaysFalse);
+  auto IsAlwaysFalseWithCast =
+      anyOf(IsAlwaysFalse, cStyleCastExpr(has(IsAlwaysFalse)).bind("castExpr"));
+  auto AssertExprRoot =
+      anyOf(binaryOperator(
+                hasAnyOperatorName("&&", "=="),
+                hasEitherOperand(stringLiteral().bind("assertMSG")),
+                anyOf(binaryOperator(hasEitherOperand(IsAlwaysFalseWithCast)),
+                      anything()))
+                .bind("assertExprRoot"),
+            IsAlwaysFalse);
   auto NonConstexprFunctionCall =
       callExpr(hasDeclaration(functionDecl(unless(isConstexpr()))));
   auto AssertCondition =
-      expr(
-          anyOf(expr(ignoringParenCasts(anyOf(
-                    AssertExprRoot, unaryOperator(hasUnaryOperand(
-                                        ignoringParenCasts(AssertExprRoot)))))),
-                anything()),
-          unless(findAll(NonConstexprFunctionCall)))
+      expr(anyOf(anyOf(AssertExprRoot,
+                       unaryOperator(hasUnaryOperand(AssertExprRoot))),
+                 anything()),
+           unless(findAll(NonConstexprFunctionCall)))
           .bind("condition");
   auto Condition =
-      anyOf(ignoringParenImpCasts(callExpr(
-                hasDeclaration(functionDecl(hasName("__builtin_expect"))),
-                hasArgument(0, AssertCondition))),
+      anyOf(callExpr(hasDeclaration(functionDecl(hasName("__builtin_expect"))),
+                     hasArgument(0, AssertCondition)),
             AssertCondition);
 
   Finder->addMatcher(conditionalOperator(hasCondition(Condition),
Index: clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp
+++ clang-tools-extra/clang-tidy/hicpp/SignedBitwiseCheck.cpp
@@ -31,9 +31,8 @@
 void SignedBitwiseCheck::registerMatchers(MatchFinder *Finder) {
   const auto SignedIntegerOperand =
       (IgnorePositiveIntegerLiterals
-           ? expr(ignoringImpCasts(hasType(isSignedInteger())),
-                  unless(integerLiteral()))
-           : expr(ignoringImpCasts(hasType(isSignedInteger()))))
+           ? expr(hasType(isSignedInteger()), unless(integerLiteral()))
+           : expr(hasType(isSignedInteger())))
           .bind("signed-operand");
 
   // The standard [bitmask.types] allows some integral types to be implemented
@@ -44,7 +43,7 @@
       hasAnyName("::std::locale::category", "::std::ctype_base::mask",
                  "::std::ios_base::fmtflags", "::std::ios_base::iostate",
                  "::std::ios_base::openmode"));
-  const auto IsStdBitmask = ignoringImpCasts(declRefExpr(hasType(BitmaskType)));
+  const auto IsStdBitmask = declRefExpr(hasType(BitmaskType));
 
   // Match binary bitwise operations on signed integer arguments.
   Finder->addMatcher(
Index: clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
+++ clang-tools-extra/clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp
@@ -29,14 +29,13 @@
               // Match on switch statements that have either a bit-field or
               // an integer condition. The ordering in 'anyOf()' is
               // important because the last condition is the most general.
-              anyOf(ignoringImpCasts(memberExpr(hasDeclaration(
-                        fieldDecl(isBitField()).bind("bitfield")))),
-                    ignoringImpCasts(declRefExpr().bind("non-enum-condition"))),
+              anyOf(memberExpr(hasDeclaration(
+                        fieldDecl(isBitField()).bind("bitfield"))),
+                    declRefExpr().bind("non-enum-condition")),
               // 'unless()' must be the last match here and must be bound,
               // otherwise the matcher does not work correctly, because it
               // will not explicitly ignore enum conditions.
-              unless(ignoringImpCasts(
-                  declRefExpr(hasType(enumType())).bind("enum-condition"))))))
+              unless(declRefExpr(hasType(enumType())).bind("enum-condition")))))
           .bind("switch"),
       this);
 
@@ -115,7 +114,7 @@
   }
   // Warns for degenerated 'switch' statements that neither define a case nor
   // a default label.
-  // FIXME: Evaluate, if emitting a fix-it to simplify that statement is 
+  // FIXME: Evaluate, if emitting a fix-it to simplify that statement is
   // reasonable.
   if (!SwitchHasDefault && SwitchCaseCount == 0) {
     diag(Switch->getBeginLoc(),
Index: clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
+++ clang-tools-extra/clang-tidy/google/ExplicitMakePairCheck.cpp
@@ -30,10 +30,9 @@
   // templates.
   Finder->addMatcher(
       callExpr(unless(isInTemplateInstantiation()),
-               callee(expr(ignoringParenImpCasts(
-                   declRefExpr(hasExplicitTemplateArgs(),
-                               to(functionDecl(hasName("::std::make_pair"))))
-                       .bind("declref")))))
+               callee(declRefExpr(hasExplicitTemplateArgs(),
+                                  to(functionDecl(hasName("::std::make_pair"))))
+                          .bind("declref")))
           .bind("call"),
       this);
 }
Index: clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
+++ clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsPointerArithmeticCheck.cpp
@@ -26,9 +26,8 @@
 
   // Flag all operators +, -, +=, -=, ++, -- that result in a pointer
   Finder->addMatcher(
-      binaryOperator(
-          hasAnyOperatorName("+", "-", "+=", "-="), AllPointerTypes,
-          unless(hasLHS(ignoringImpCasts(declRefExpr(to(isImplicit()))))))
+      binaryOperator(hasAnyOperatorName("+", "-", "+=", "-="), AllPointerTypes,
+                     unless(hasLHS(declRefExpr(to(isImplicit())))))
           .bind("expr"),
       this);
 
@@ -40,9 +39,8 @@
   // Array subscript on a pointer (not an array) is also pointer arithmetic
   Finder->addMatcher(
       arraySubscriptExpr(
-          hasBase(ignoringImpCasts(
-              anyOf(AllPointerTypes,
-                    hasType(decayedType(hasDecayedType(pointerType())))))))
+          hasBase(anyOf(AllPointerTypes,
+                        hasType(decayedType(hasDecayedType(pointerType()))))))
           .bind("expr"),
       this);
 }
Index: clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
+++ clang-tools-extra/clang-tidy/cppcoreguidelines/ProBoundsConstantArrayIndexCheck.cpp
@@ -42,9 +42,9 @@
   // Note: if a struct contains an array member, the compiler-generated
   // constructor has an arraySubscriptExpr.
   Finder->addMatcher(
-      arraySubscriptExpr(
-          hasBase(ignoringImpCasts(hasType(constantArrayType().bind("type")))),
-          hasIndex(expr().bind("index")), unless(hasAncestor(isImplicit())))
+      arraySubscriptExpr(hasBase(hasType(constantArrayType().bind("type"))),
+                         hasIndex(expr().bind("index")),
+                         unless(hasAncestor(isImplicit())))
           .bind("expr"),
       this);
 
Index: clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/UnusedReturnValueCheck.cpp
@@ -134,13 +134,13 @@
 
 void UnusedReturnValueCheck::registerMatchers(MatchFinder *Finder) {
   auto FunVec = utils::options::parseStringList(CheckedFunctions);
-  auto MatchedCallExpr = expr(ignoringImplicit(ignoringParenImpCasts(
+  auto MatchedCallExpr =
       callExpr(callee(functionDecl(
                    // Don't match void overloads of checked functions.
                    unless(returns(voidType())),
                    isInstantiatedFrom(hasAnyName(
                        std::vector<StringRef>(FunVec.begin(), FunVec.end()))))))
-          .bind("match"))));
+          .bind("match");
 
   auto UnusedInCompoundStmt =
       compoundStmt(forEach(MatchedCallExpr),
Index: clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/TerminatingContinueCheck.cpp
@@ -20,9 +20,9 @@
 
 void TerminatingContinueCheck::registerMatchers(MatchFinder *Finder) {
   const auto doWithFalse =
-      doStmt(hasCondition(ignoringImpCasts(
-                 anyOf(cxxBoolLiteral(equals(false)), integerLiteral(equals(0)),
-                       cxxNullPtrLiteralExpr(), gnuNullExpr()))),
+      doStmt(hasCondition(anyOf(cxxBoolLiteral(equals(false)),
+                                integerLiteral(equals(0)),
+                                cxxNullPtrLiteralExpr(), gnuNullExpr())),
              equalsBoundNode("closestLoop"));
 
   Finder->addMatcher(
Index: clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/SuspiciousMissingCommaCheck.cpp
@@ -87,9 +87,8 @@
   const auto ConcatenatedStringLiteral =
       stringLiteral(isConcatenatedLiteral(MaxConcatenatedTokens)).bind("str");
 
-  const auto StringsInitializerList =
-      initListExpr(hasType(constantArrayType()),
-                   has(ignoringParenImpCasts(expr(ConcatenatedStringLiteral))));
+  const auto StringsInitializerList = initListExpr(
+      hasType(constantArrayType()), has(ConcatenatedStringLiteral));
 
   Finder->addMatcher(StringsInitializerList.bind("list"), this);
 }
Index: clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp
@@ -118,24 +118,22 @@
 
 void SuspiciousEnumUsageCheck::registerMatchers(MatchFinder *Finder) {
   const auto enumExpr = [](StringRef RefName, StringRef DeclName) {
-    return expr(ignoringImpCasts(expr().bind(RefName)),
-                ignoringImpCasts(hasType(enumDecl().bind(DeclName))));
+    return expr(expr().bind(RefName), hasType(enumDecl().bind(DeclName)));
   };
 
   Finder->addMatcher(
-      binaryOperator(hasOperatorName("|"), hasLHS(enumExpr("", "enumDecl")),
-                     hasRHS(expr(enumExpr("", "otherEnumDecl"),
-                                 ignoringImpCasts(hasType(enumDecl(
-                                     unless(equalsBoundNode("enumDecl"))))))))
+      binaryOperator(
+          hasOperatorName("|"), hasLHS(enumExpr("", "enumDecl")),
+          hasRHS(expr(enumExpr("", "otherEnumDecl"),
+                      hasType(enumDecl(unless(equalsBoundNode("enumDecl")))))))
           .bind("diffEnumOp"),
       this);
 
   Finder->addMatcher(
-      binaryOperator(hasAnyOperatorName("+", "|"),
-                     hasLHS(enumExpr("lhsExpr", "enumDecl")),
-                     hasRHS(expr(enumExpr("rhsExpr", ""),
-                                 ignoringImpCasts(hasType(
-                                     enumDecl(equalsBoundNode("enumDecl"))))))),
+      binaryOperator(
+          hasAnyOperatorName("+", "|"), hasLHS(enumExpr("lhsExpr", "enumDecl")),
+          hasRHS(expr(enumExpr("rhsExpr", ""),
+                      hasType(enumDecl(equalsBoundNode("enumDecl")))))),
       this);
 
   Finder->addMatcher(
Index: clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp
@@ -34,8 +34,7 @@
   if (!getLangOpts().CPlusPlus)
     return;
 
-  const auto StrLitWithNul =
-      ignoringParenImpCasts(stringLiteral(containsNul()).bind("truncated"));
+  const auto StrLitWithNul = stringLiteral(containsNul()).bind("truncated");
 
   // Match string constructor.
   const auto StringConstructorExpr = expr(anyOf(
Index: clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/StringIntegerAssignmentCheck.cpp
@@ -26,18 +26,16 @@
               hasTemplateArgument(0, refersToType(hasCanonicalType(
                                          qualType().bind("type")))))))),
           hasArgument(
-              1,
-              ignoringImpCasts(
-                  expr(hasType(isInteger()), unless(hasType(isAnyCharacter())),
-                       // Ignore calls to tolower/toupper (see PR27723).
-                       unless(callExpr(callee(functionDecl(
-                           hasAnyName("tolower", "std::tolower", "toupper",
-                                      "std::toupper"))))),
-                       // Do not warn if assigning e.g. `CodePoint` to
-                       // `basic_string<CodePoint>`
-                       unless(hasType(qualType(
-                           hasCanonicalType(equalsBoundNode("type"))))))
-                      .bind("expr"))),
+              1, expr(hasType(isInteger()), unless(hasType(isAnyCharacter())),
+                      // Ignore calls to tolower/toupper (see PR27723).
+                      unless(callExpr(callee(functionDecl(
+                          hasAnyName("tolower", "std::tolower", "toupper",
+                                     "std::toupper"))))),
+                      // Do not warn if assigning e.g. `CodePoint` to
+                      // `basic_string<CodePoint>`
+                      unless(hasType(
+                          qualType(hasCanonicalType(equalsBoundNode("type"))))))
+                     .bind("expr")),
           unless(isInTemplateInstantiation())),
       this);
 }
Index: clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/StringConstructorCheck.cpp
@@ -35,27 +35,26 @@
 }
 
 void StringConstructorCheck::registerMatchers(MatchFinder *Finder) {
-  const auto ZeroExpr = expr(ignoringParenImpCasts(integerLiteral(equals(0))));
-  const auto CharExpr = expr(ignoringParenImpCasts(characterLiteral()));
-  const auto NegativeExpr = expr(ignoringParenImpCasts(
-      unaryOperator(hasOperatorName("-"),
-                    hasUnaryOperand(integerLiteral(unless(equals(0)))))));
-  const auto LargeLengthExpr = expr(ignoringParenImpCasts(
-      integerLiteral(isBiggerThan(LargeLengthThreshold))));
+  const auto ZeroExpr = integerLiteral(equals(0));
+  const auto NegativeExpr = unaryOperator(
+      hasOperatorName("-"), hasUnaryOperand(integerLiteral(unless(equals(0)))));
+  const auto LargeLengthExpr =
+      integerLiteral(isBiggerThan(LargeLengthThreshold));
   const auto CharPtrType = type(anyOf(pointerType(), arrayType()));
 
   // Match a string-literal; even through a declaration with initializer.
   const auto BoundStringLiteral = stringLiteral().bind("str");
-  const auto ConstStrLiteralDecl = varDecl(
-      isDefinition(), hasType(constantArrayType()), hasType(isConstQualified()),
-      hasInitializer(ignoringParenImpCasts(BoundStringLiteral)));
+  const auto ConstStrLiteralDecl =
+      varDecl(isDefinition(), hasType(constantArrayType()),
+              hasType(isConstQualified()), hasInitializer(BoundStringLiteral));
   const auto ConstPtrStrLiteralDecl = varDecl(
       isDefinition(),
       hasType(pointerType(pointee(isAnyCharacter(), isConstQualified()))),
-      hasInitializer(ignoringParenImpCasts(BoundStringLiteral)));
-  const auto ConstStrLiteral = expr(ignoringParenImpCasts(anyOf(
-      BoundStringLiteral, declRefExpr(hasDeclaration(anyOf(
-                              ConstPtrStrLiteralDecl, ConstStrLiteralDecl))))));
+      hasInitializer(BoundStringLiteral));
+  const auto ConstStrLiteral =
+      expr(anyOf(BoundStringLiteral,
+                 declRefExpr(hasDeclaration(
+                     anyOf(ConstPtrStrLiteralDecl, ConstStrLiteralDecl)))));
 
   // Check the fill constructor. Fills the string with n consecutive copies of
   // character c. [i.e string(size_t n, char c);].
@@ -66,7 +65,7 @@
           hasArgument(1, hasType(qualType(isInteger()))),
           anyOf(
               // Detect the expression: string('x', 40);
-              hasArgument(0, CharExpr.bind("swapped-parameter")),
+              hasArgument(0, characterLiteral().bind("swapped-parameter")),
               // Detect the expression: string(0, ...);
               hasArgument(0, ZeroExpr.bind("empty-string")),
               // Detect the expression: string(-4, ...);
@@ -92,8 +91,7 @@
               hasArgument(1, LargeLengthExpr.bind("large-length")),
               // Detect the expression: string("lit", 5)
               allOf(hasArgument(0, ConstStrLiteral.bind("literal-with-length")),
-                    hasArgument(1, ignoringParenImpCasts(
-                                       integerLiteral().bind("int"))))))
+                    hasArgument(1, integerLiteral().bind("int")))))
           .bind("constructor"),
       this);
 
Index: clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/SizeofExpressionCheck.cpp
@@ -77,103 +77,91 @@
 }
 
 void SizeofExpressionCheck::registerMatchers(MatchFinder *Finder) {
-  const auto IntegerExpr = ignoringParenImpCasts(integerLiteral());
-  const auto ConstantExpr = expr(ignoringParenImpCasts(
-      anyOf(integerLiteral(), unaryOperator(hasUnaryOperand(IntegerExpr)),
-            binaryOperator(hasLHS(IntegerExpr), hasRHS(IntegerExpr)))));
-  const auto IntegerCallExpr = expr(ignoringParenImpCasts(
+  const auto ConstantExpr = expr(anyOf(
+      integerLiteral(), unaryOperator(hasUnaryOperand(integerLiteral())),
+      binaryOperator(hasLHS(integerLiteral()), hasRHS(integerLiteral()))));
+  const auto IntegerCallExpr =
       callExpr(anyOf(hasType(isInteger()), hasType(enumType())),
-               unless(isInTemplateInstantiation()))));
+               unless(isInTemplateInstantiation()));
   const auto SizeOfExpr = expr(anyOf(
       sizeOfExpr(
           has(hasUnqualifiedDesugaredType(type().bind("sizeof-arg-type")))),
       sizeOfExpr(has(expr(hasType(
           hasUnqualifiedDesugaredType(type().bind("sizeof-arg-type"))))))));
-  const auto SizeOfZero = expr(
-      sizeOfExpr(has(ignoringParenImpCasts(expr(integerLiteral(equals(0)))))));
+  const auto SizeOfZero = expr(sizeOfExpr(has(integerLiteral(equals(0)))));
 
   // Detect expression like: sizeof(ARRAYLEN);
   // Note: The expression 'sizeof(sizeof(0))' is a portable trick used to know
   //       the sizeof size_t.
   if (WarnOnSizeOfConstant) {
-    Finder->addMatcher(
-        expr(sizeOfExpr(has(ignoringParenImpCasts(ConstantExpr))),
-             unless(SizeOfZero))
-            .bind("sizeof-constant"),
-        this);
+    Finder->addMatcher(expr(sizeOfExpr(has(ConstantExpr)), unless(SizeOfZero))
+                           .bind("sizeof-constant"),
+                       this);
   }
 
   // Detect sizeof(f())
   if (WarnOnSizeOfIntegerExpression) {
     Finder->addMatcher(
-        expr(sizeOfExpr(ignoringParenImpCasts(has(IntegerCallExpr))))
-            .bind("sizeof-integer-call"),
-        this);
+        sizeOfExpr(has(IntegerCallExpr)).bind("sizeof-integer-call"), this);
   }
 
   // Detect expression like: sizeof(this);
   if (WarnOnSizeOfThis) {
-    Finder->addMatcher(
-        expr(sizeOfExpr(has(ignoringParenImpCasts(expr(cxxThisExpr())))))
-            .bind("sizeof-this"),
-        this);
+    Finder->addMatcher(sizeOfExpr(has(cxxThisExpr())).bind("sizeof-this"),
+                       this);
   }
 
   // Detect sizeof(kPtr) where kPtr is 'const char* kPtr = "abc"';
   const auto CharPtrType = pointerType(pointee(isAnyCharacter()));
   const auto ConstStrLiteralDecl =
       varDecl(isDefinition(), hasType(qualType(hasCanonicalType(CharPtrType))),
-              hasInitializer(ignoringParenImpCasts(stringLiteral())));
-  Finder->addMatcher(expr(sizeOfExpr(has(ignoringParenImpCasts(expr(
-                              hasType(qualType(hasCanonicalType(CharPtrType))),
-                              ignoringParenImpCasts(declRefExpr(
-                                  hasDeclaration(ConstStrLiteralDecl))))))))
-                         .bind("sizeof-charp"),
-                     this);
+              hasInitializer(stringLiteral()));
+  Finder->addMatcher(
+      expr(sizeOfExpr(
+               has(expr(hasType(qualType(hasCanonicalType(CharPtrType))),
+                        declRefExpr(hasDeclaration(ConstStrLiteralDecl))))))
+          .bind("sizeof-charp"),
+      this);
 
   // Detect sizeof(ptr) where ptr points to an aggregate (i.e. sizeof(&S)).
-  const auto ArrayExpr = expr(ignoringParenImpCasts(
-      expr(hasType(qualType(hasCanonicalType(arrayType()))))));
+  const auto ArrayExpr = expr(hasType(qualType(hasCanonicalType(arrayType()))));
   const auto ArrayCastExpr = expr(anyOf(
       unaryOperator(hasUnaryOperand(ArrayExpr), unless(hasOperatorName("*"))),
       binaryOperator(hasEitherOperand(ArrayExpr)),
       castExpr(hasSourceExpression(ArrayExpr))));
-  const auto PointerToArrayExpr = expr(ignoringParenImpCasts(expr(
-      hasType(qualType(hasCanonicalType(pointerType(pointee(arrayType()))))))));
+  const auto PointerToArrayExpr = expr(
+      hasType(qualType(hasCanonicalType(pointerType(pointee(arrayType()))))));
 
-  const auto StructAddrOfExpr =
-      unaryOperator(hasOperatorName("&"),
-                    hasUnaryOperand(ignoringParenImpCasts(expr(
-                        hasType(qualType(hasCanonicalType(recordType())))))));
+  const auto StructAddrOfExpr = unaryOperator(
+      hasOperatorName("&"),
+      hasUnaryOperand(hasType(qualType(hasCanonicalType(recordType())))));
   const auto PointerToStructType = type(hasUnqualifiedDesugaredType(
       pointerType(pointee(recordType()))));
-  const auto PointerToStructExpr = expr(ignoringParenImpCasts(expr(
-      hasType(qualType(hasCanonicalType(PointerToStructType))),
-      unless(cxxThisExpr()))));
-
-  Finder->addMatcher(
-      expr(anyOf(sizeOfExpr(has(expr(ignoringParenImpCasts(
-               anyOf(ArrayCastExpr, PointerToArrayExpr, StructAddrOfExpr,
-                     PointerToStructExpr))))),
-                            sizeOfExpr(has(PointerToStructType))))
-          .bind("sizeof-pointer-to-aggregate"),
-      this);
+  const auto PointerToStructExpr =
+      expr(hasType(qualType(hasCanonicalType(PointerToStructType))),
+           unless(cxxThisExpr()));
+
+  Finder->addMatcher(expr(anyOf(sizeOfExpr(has(expr(anyOf(
+                                    ArrayCastExpr, PointerToArrayExpr,
+                                    StructAddrOfExpr, PointerToStructExpr)))),
+                                sizeOfExpr(has(PointerToStructType))))
+                         .bind("sizeof-pointer-to-aggregate"),
+                     this);
 
   // Detect expression like: sizeof(epxr) <= k for a suspicious constant 'k'.
   if (WarnOnSizeOfCompareToConstant) {
     Finder->addMatcher(
-        binaryOperator(matchers::isRelationalOperator(),
-                       hasOperands(ignoringParenImpCasts(SizeOfExpr),
-                                   ignoringParenImpCasts(anyOf(
-                                       integerLiteral(equals(0)),
-                                       integerLiteral(isBiggerThan(0x80000))))))
+        binaryOperator(
+            matchers::isRelationalOperator(),
+            hasOperands(SizeOfExpr,
+                        anyOf(integerLiteral(equals(0)),
+                              integerLiteral(isBiggerThan(0x80000)))))
             .bind("sizeof-compare-constant"),
         this);
   }
 
   // Detect expression like: sizeof(expr, expr); most likely an error.
-  Finder->addMatcher(expr(sizeOfExpr(has(expr(ignoringParenImpCasts(
-                              binaryOperator(hasOperatorName(",")))))))
+  Finder->addMatcher(sizeOfExpr(has(binaryOperator(hasOperatorName(","))))
                          .bind("sizeof-comma-expr"),
                      this);
 
@@ -186,40 +174,35 @@
   const auto DenomType = qualType(hasCanonicalType(type().bind("denom-type")));
 
   Finder->addMatcher(
-      binaryOperator(hasOperatorName("/"),
-                     hasLHS(expr(ignoringParenImpCasts(
-                         anyOf(sizeOfExpr(has(NumType)),
-                               sizeOfExpr(has(expr(hasType(NumType)))))))),
-                     hasRHS(expr(ignoringParenImpCasts(
-                         anyOf(sizeOfExpr(has(DenomType)),
-                               sizeOfExpr(has(expr(hasType(DenomType)))))))))
+      binaryOperator(
+          hasOperatorName("/"),
+          hasLHS(expr(anyOf(sizeOfExpr(has(NumType)),
+                            sizeOfExpr(has(expr(hasType(NumType))))))),
+          hasRHS(expr(anyOf(sizeOfExpr(has(DenomType)),
+                            sizeOfExpr(has(expr(hasType(DenomType))))))))
           .bind("sizeof-divide-expr"),
       this);
 
   // Detect expression like: sizeof(...) * sizeof(...)); most likely an error.
-  Finder->addMatcher(binaryOperator(hasOperatorName("*"),
-                                    hasLHS(ignoringParenImpCasts(SizeOfExpr)),
-                                    hasRHS(ignoringParenImpCasts(SizeOfExpr)))
+  Finder->addMatcher(binaryOperator(hasOperatorName("*"), hasLHS(SizeOfExpr),
+                                    hasRHS(SizeOfExpr))
                          .bind("sizeof-multiply-sizeof"),
                      this);
 
   Finder->addMatcher(
-      binaryOperator(hasOperatorName("*"),
-                     hasOperands(ignoringParenImpCasts(SizeOfExpr),
-                                 ignoringParenImpCasts(binaryOperator(
-                                     hasOperatorName("*"),
-                                     hasEitherOperand(
-                                         ignoringParenImpCasts(SizeOfExpr))))))
+      binaryOperator(
+          hasOperatorName("*"),
+          hasOperands(SizeOfExpr, binaryOperator(hasOperatorName("*"),
+                                                 hasEitherOperand(SizeOfExpr))))
           .bind("sizeof-multiply-sizeof"),
       this);
 
   // Detect strange double-sizeof expression like: sizeof(sizeof(...));
   // Note: The expression 'sizeof(sizeof(0))' is accepted.
-  Finder->addMatcher(
-      expr(sizeOfExpr(has(ignoringParenImpCasts(expr(
-               hasSizeOfDescendant(8, expr(SizeOfExpr, unless(SizeOfZero))))))))
-          .bind("sizeof-sizeof-expr"),
-      this);
+  Finder->addMatcher(sizeOfExpr(has(hasSizeOfDescendant(
+                                    8, expr(SizeOfExpr, unless(SizeOfZero)))))
+                         .bind("sizeof-sizeof-expr"),
+                     this);
 
   // Detect sizeof in pointer arithmetic like: N * sizeof(S) == P1 - P2 or
   // (P1 - P2) / sizeof(S) where P1 and P2 are pointers to type S.
@@ -233,18 +216,15 @@
   Finder->addMatcher(
       binaryOperator(
           hasAnyOperatorName("==", "!=", "<", "<=", ">", ">=", "+", "-"),
-          hasOperands(expr(anyOf(ignoringParenImpCasts(SizeOfExpr),
-                                 ignoringParenImpCasts(binaryOperator(
-                                     hasOperatorName("*"),
-                                     hasEitherOperand(
-                                         ignoringParenImpCasts(SizeOfExpr)))))),
-                      ignoringParenImpCasts(PtrDiffExpr)))
+          hasOperands(
+              anyOf(SizeOfExpr, binaryOperator(hasOperatorName("*"),
+                                               hasEitherOperand(SizeOfExpr))),
+              PtrDiffExpr))
           .bind("sizeof-in-ptr-arithmetic-mul"),
       this);
 
-  Finder->addMatcher(binaryOperator(hasOperatorName("/"),
-                                    hasLHS(ignoringParenImpCasts(PtrDiffExpr)),
-                                    hasRHS(ignoringParenImpCasts(SizeOfExpr)))
+  Finder->addMatcher(binaryOperator(hasOperatorName("/"), hasLHS(PtrDiffExpr),
+                                    hasRHS(SizeOfExpr))
                          .bind("sizeof-in-ptr-arithmetic-div"),
                      this);
 }
Index: clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/SizeofContainerCheck.cpp
@@ -19,18 +19,18 @@
 void SizeofContainerCheck::registerMatchers(MatchFinder *Finder) {
   Finder->addMatcher(
       expr(unless(isInTemplateInstantiation()),
-           expr(sizeOfExpr(has(ignoringParenImpCasts(
+           expr(sizeOfExpr(has(
                     expr(hasType(hasCanonicalType(hasDeclaration(cxxRecordDecl(
                         matchesName("^(::std::|::string)"),
                         unless(matchesName("^::std::(bitset|array)$")),
                         hasMethod(cxxMethodDecl(hasName("size"), isPublic(),
-                                                isConst())))))))))))
+                                                isConst()))))))))))
                .bind("sizeof"),
            // Ignore ARRAYSIZE(<array of containers>) pattern.
-           unless(hasAncestor(binaryOperator(
-               hasAnyOperatorName("/", "%"),
-               hasLHS(ignoringParenCasts(sizeOfExpr(expr()))),
-               hasRHS(ignoringParenCasts(equalsBoundNode("sizeof"))))))),
+           unless(
+               hasAncestor(binaryOperator(hasAnyOperatorName("/", "%"),
+                                          hasLHS(sizeOfExpr(expr())),
+                                          hasRHS(equalsBoundNode("sizeof")))))),
       this);
 }
 
Index: clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
@@ -520,18 +520,17 @@
   if (InnerMatcher.matches(*SimpleNode, Finder, Builder))
     return true;
 
-  auto DREHasInit = ignoringImpCasts(
-      declRefExpr(to(varDecl(hasInitializer(ignoringImpCasts(InnerMatcher))))));
+  auto DREHasInit = declRefExpr(to(varDecl(hasInitializer(InnerMatcher))));
 
   if (DREHasInit.matches(*SimpleNode, Finder, Builder))
     return true;
 
   const char *const VarDeclName = "variable-declaration";
-  auto DREHasDefinition = ignoringImpCasts(declRefExpr(
+  auto DREHasDefinition = declRefExpr(
       allOf(to(varDecl().bind(VarDeclName)),
             hasAncestor(compoundStmt(hasDescendant(binaryOperator(
                 hasLHS(declRefExpr(to(varDecl(equalsBoundNode(VarDeclName))))),
-                hasRHS(ignoringImpCasts(InnerMatcher)))))))));
+                hasRHS(InnerMatcher)))))));
 
   if (DREHasDefinition.matches(*SimpleNode, Finder, Builder))
     return true;
@@ -542,19 +541,17 @@
 
 void NotNullTerminatedResultCheck::registerMatchers(MatchFinder *Finder) {
   auto IncOp =
-      binaryOperator(hasOperatorName("+"),
-                     hasEitherOperand(ignoringParenImpCasts(integerLiteral())));
+      binaryOperator(hasOperatorName("+"), hasEitherOperand(integerLiteral()));
 
   auto DecOp =
-      binaryOperator(hasOperatorName("-"),
-                     hasEitherOperand(ignoringParenImpCasts(integerLiteral())));
+      binaryOperator(hasOperatorName("-"), hasEitherOperand(integerLiteral()));
 
-  auto HasIncOp = anyOf(ignoringImpCasts(IncOp), hasDescendant(IncOp));
-  auto HasDecOp = anyOf(ignoringImpCasts(DecOp), hasDescendant(DecOp));
+  auto HasIncOp = anyOf(IncOp, hasDescendant(IncOp));
+  auto HasDecOp = anyOf(DecOp, hasDescendant(DecOp));
 
-  auto Container = ignoringImpCasts(cxxMemberCallExpr(hasDescendant(declRefExpr(
+  auto Container = cxxMemberCallExpr(hasDescendant(declRefExpr(
       hasType(hasUnqualifiedDesugaredType(recordType(hasDeclaration(recordDecl(
-          hasAnyName("::std::vector", "::std::list", "::std::deque"))))))))));
+          hasAnyName("::std::vector", "::std::list", "::std::deque")))))))));
 
   auto StringTy = type(hasUnqualifiedDesugaredType(recordType(
       hasDeclaration(cxxRecordDecl(hasName("::std::basic_string"))))));
@@ -589,23 +586,21 @@
   // - Example:  char src[] = "foo";       sizeof(src);
   auto SizeOfCharExpr = unaryExprOrTypeTraitExpr(has(expr(AnyOfCharTy)));
 
-  auto WrongLength =
-      ignoringImpCasts(anyOf(Strlen, SizeOrLength, hasDescendant(Strlen),
-                             hasDescendant(SizeOrLength)));
+  auto WrongLength = anyOf(Strlen, SizeOrLength, hasDescendant(Strlen),
+                           hasDescendant(SizeOrLength));
 
   // - Example:  length = strlen(src);
-  auto DREWithoutInc =
-      ignoringImpCasts(declRefExpr(to(varDecl(hasInitializer(WrongLength)))));
+  auto DREWithoutInc = declRefExpr(to(varDecl(hasInitializer(WrongLength))));
 
   auto AnyOfCallOrDREWithoutInc = anyOf(DREWithoutInc, WrongLength);
 
   // - Example:  int getLength(const char *str) { return strlen(str); }
-  auto CallExprReturnWithoutInc = ignoringImpCasts(callExpr(callee(functionDecl(
-      hasBody(has(returnStmt(hasReturnValue(AnyOfCallOrDREWithoutInc))))))));
+  auto CallExprReturnWithoutInc = callExpr(callee(functionDecl(
+      hasBody(has(returnStmt(hasReturnValue(AnyOfCallOrDREWithoutInc)))))));
 
   // - Example:  int length = getLength(src);
-  auto DREHasReturnWithoutInc = ignoringImpCasts(
-      declRefExpr(to(varDecl(hasInitializer(CallExprReturnWithoutInc)))));
+  auto DREHasReturnWithoutInc =
+      declRefExpr(to(varDecl(hasInitializer(CallExprReturnWithoutInc))));
 
   auto AnyOfWrongLengthInit =
       anyOf(WrongLength, AnyOfCallOrDREWithoutInc, CallExprReturnWithoutInc,
@@ -629,8 +624,8 @@
                           hasDescendant(callExpr(MallocLengthExpr)));
 
   // - Example:  new char[length];
-  auto DestCXXNewExpr = ignoringImpCasts(
-      cxxNewExpr(hasArraySize(expr().bind(DestMallocExprName))));
+  auto DestCXXNewExpr =
+      cxxNewExpr(hasArraySize(expr().bind(DestMallocExprName)));
 
   auto AnyOfDestInit = anyOf(DestMalloc, DestCXXNewExpr);
 
@@ -645,29 +640,27 @@
                         expr().bind(UnknownDestName)))
           .bind(DestExprName);
 
-  auto AnyOfDestDecl = ignoringImpCasts(
+  auto AnyOfDestDecl =
       anyOf(allOf(hasDefinition(anyOf(AnyOfDestInit, DestArrayTyDecl,
                                       hasDescendant(DestArrayTyDecl))),
                   expr().bind(DestExprName)),
-            anyOf(DestUnknownDecl, hasDescendant(DestUnknownDecl))));
+            anyOf(DestUnknownDecl, hasDescendant(DestUnknownDecl)));
 
   auto NullTerminatorExpr = binaryOperator(
       hasLHS(anyOf(hasDescendant(declRefExpr(to(varDecl(
                        equalsBoundNode(std::string(DestVarDeclName)))))),
                    hasDescendant(declRefExpr(
                        equalsBoundNode(std::string(DestExprName)))))),
-      hasRHS(ignoringImpCasts(
-          anyOf(characterLiteral(equals(0U)), integerLiteral(equals(0))))));
+      hasRHS(anyOf(characterLiteral(equals(0U)), integerLiteral(equals(0)))));
 
   auto SrcDecl = declRefExpr(
       allOf(to(decl().bind(SrcVarDeclName)),
             anyOf(hasAncestor(cxxMemberCallExpr().bind(SrcExprName)),
                   expr().bind(SrcExprName))));
 
-  auto AnyOfSrcDecl =
-      ignoringImpCasts(anyOf(stringLiteral().bind(SrcExprName),
-                             hasDescendant(stringLiteral().bind(SrcExprName)),
-                             SrcDecl, hasDescendant(SrcDecl)));
+  auto AnyOfSrcDecl = anyOf(stringLiteral().bind(SrcExprName),
+                            hasDescendant(stringLiteral().bind(SrcExprName)),
+                            SrcDecl, hasDescendant(SrcDecl));
 
   //===--------------------------------------------------------------------===//
   // Match the problematic function calls.
@@ -702,19 +695,17 @@
   auto MatchGivenLength = [=](CallContext CC) {
     return hasArgument(
         CC.LengthPos,
-        allOf(
-            anyOf(
-                ignoringImpCasts(integerLiteral().bind(WrongLengthExprName)),
-                allOf(unless(hasDefinition(SizeOfCharExpr)),
-                      allOf(CC.WithIncrease
-                                ? ignoringImpCasts(hasDefinition(HasIncOp))
-                                : ignoringImpCasts(allOf(
-                                      unless(hasDefinition(HasIncOp)),
-                                      anyOf(hasDefinition(binaryOperator().bind(
-                                                UnknownLengthName)),
-                                            hasDefinition(anything())))),
-                            AnyOfWrongLengthInit))),
-            expr().bind(LengthExprName)));
+        allOf(anyOf(integerLiteral().bind(WrongLengthExprName),
+                    allOf(unless(hasDefinition(SizeOfCharExpr)),
+                          allOf(CC.WithIncrease
+                                    ? hasDefinition(HasIncOp)
+                                    : allOf(unless(hasDefinition(HasIncOp)),
+                                            anyOf(hasDefinition(
+                                                      binaryOperator().bind(
+                                                          UnknownLengthName)),
+                                                  hasDefinition(anything()))),
+                                AnyOfWrongLengthInit))),
+              expr().bind(LengthExprName)));
   };
 
   auto MatchCall = [=](CallContext CC) {
Index: clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/MoveForwardingReferenceCheck.cpp
@@ -83,8 +83,7 @@
                               hasUnderlyingDecl(hasName("::std::move")))))
                           .bind("lookup")),
                argumentCountIs(1),
-               hasArgument(0, ignoringParenImpCasts(declRefExpr(
-                                  to(ForwardingReferenceParmMatcher)))))
+               hasArgument(0, declRefExpr(to(ForwardingReferenceParmMatcher))))
           .bind("call-move"),
       this);
 }
Index: clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
+++ clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
@@ -25,8 +25,7 @@
 
   const auto AllocFuncPtr =
       varDecl(hasType(isConstQualified()),
-              hasInitializer(ignoringParenImpCasts(
-                  declRefExpr(hasDeclaration(AllocFunc)))));
+              hasInitializer(declRefExpr(hasDeclaration(AllocFunc))));
 
   const auto AdditiveOperator = binaryOperator(hasAnyOperatorName("+", "-"));
 
Index: clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
+++ clang-tools-extra/clang-tidy/abseil/StringFindStartswithCheck.cpp
@@ -50,10 +50,8 @@
 
   Finder->addMatcher(
       // Match [=!]= with a zero on one side and a string.find on the other.
-      binaryOperator(
-          hasAnyOperatorName("==", "!="),
-          hasOperands(ignoringParenImpCasts(ZeroLiteral),
-                      ignoringParenImpCasts(StringFind.bind("findexpr"))))
+      binaryOperator(hasAnyOperatorName("==", "!="),
+                     hasOperands(ZeroLiteral, StringFind.bind("findexpr")))
           .bind("expr"),
       this);
 }
Index: clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
+++ clang-tools-extra/clang-tidy/abseil/DurationUnnecessaryConversionCheck.cpp
@@ -30,9 +30,9 @@
 
     // Matcher which matches the current scale's factory with a `1` argument,
     // e.g. `absl::Seconds(1)`.
-    auto factory_matcher = ignoringElidableConstructorCall(
+    auto factory_matcher =
         callExpr(callee(functionDecl(hasName(DurationFactory))),
-                 hasArgument(0, ignoringImpCasts(integerLiteral(equals(1))))));
+                 hasArgument(0, integerLiteral(equals(1))));
 
     // Matcher which matches either inverse function and binds its argument,
     // e.g. `absl::ToDoubleSeconds(dur)`.
@@ -54,14 +54,14 @@
 
     // Matcher which matches a duration argument being scaled,
     // e.g. `absl::ToDoubleSeconds(dur) * 2`
-    auto scalar_matcher = ignoringImpCasts(
-        binaryOperator(hasOperatorName("*"),
-                       hasEitherOperand(expr(ignoringParenImpCasts(
-                           callExpr(callee(functionDecl(hasAnyName(
-                                        FloatConversion, IntegerConversion))),
-                                    hasArgument(0, expr().bind("arg")))
-                               .bind("inner_call")))))
-            .bind("binop"));
+    auto scalar_matcher =
+        binaryOperator(
+            hasOperatorName("*"),
+            hasEitherOperand(callExpr(callee(functionDecl(hasAnyName(
+                                          FloatConversion, IntegerConversion))),
+                                      hasArgument(0, expr().bind("arg")))
+                                 .bind("inner_call")))
+            .bind("binop");
 
     Finder->addMatcher(
         callExpr(callee(functionDecl(hasName(DurationFactory))),
Index: clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
===================================================================
--- clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
+++ clang-tools-extra/clang-tidy/abseil/DurationRewriter.cpp
@@ -163,8 +163,8 @@
 
   // Check to see if we're using a zero directly.
   if (selectFirst<const clang::Expr>(
-          "val", match(expr(ignoringImpCasts(ZeroMatcher)).bind("val"), Node,
-                       *Result.Context)) != nullptr)
+          "val", match(expr(ZeroMatcher).bind("val"), Node, *Result.Context)) !=
+      nullptr)
     return true;
 
   // Now check to see if we're using a functional cast with a scalar
Index: clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp
+++ clang-tools-extra/clang-tidy/abseil/DurationFactoryScaleCheck.cpp
@@ -116,18 +116,17 @@
           callee(functionDecl(DurationFactoryFunction()).bind("call_decl")),
           hasArgument(
               0,
-              ignoringImpCasts(anyOf(
-                  cxxFunctionalCastExpr(
-                      hasDestinationType(
-                          anyOf(isInteger(), realFloatingPointType())),
-                      hasSourceExpression(initListExpr())),
-                  integerLiteral(equals(0)), floatLiteral(equals(0.0)),
-                  binaryOperator(hasOperatorName("*"),
-                                 hasEitherOperand(ignoringImpCasts(
-                                     anyOf(integerLiteral(), floatLiteral()))))
-                      .bind("mult_binop"),
-                  binaryOperator(hasOperatorName("/"), hasRHS(floatLiteral()))
-                      .bind("div_binop")))))
+              anyOf(cxxFunctionalCastExpr(
+                        hasDestinationType(
+                            anyOf(isInteger(), realFloatingPointType())),
+                        hasSourceExpression(initListExpr())),
+                    integerLiteral(equals(0)), floatLiteral(equals(0.0)),
+                    binaryOperator(hasOperatorName("*"),
+                                   hasEitherOperand(
+                                       anyOf(integerLiteral(), floatLiteral())))
+                        .bind("mult_binop"),
+                    binaryOperator(hasOperatorName("/"), hasRHS(floatLiteral()))
+                        .bind("div_binop"))))
           .bind("call"),
       this);
 }
Index: clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp
+++ clang-tools-extra/clang-tidy/abseil/DurationConversionCastCheck.cpp
@@ -19,9 +19,9 @@
 namespace abseil {
 
 void DurationConversionCastCheck::registerMatchers(MatchFinder *Finder) {
-  auto CallMatcher = ignoringImpCasts(callExpr(
+  auto CallMatcher = callExpr(
       callee(functionDecl(DurationConversionFunction()).bind("func_decl")),
-      hasArgument(0, expr().bind("arg"))));
+      hasArgument(0, expr().bind("arg")));
 
   Finder->addMatcher(
       expr(anyOf(
Index: clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp
+++ clang-tools-extra/clang-tidy/abseil/DurationAdditionCheck.cpp
@@ -21,10 +21,10 @@
 void DurationAdditionCheck::registerMatchers(MatchFinder *Finder) {
   Finder->addMatcher(
       binaryOperator(hasOperatorName("+"),
-                     hasEitherOperand(expr(ignoringParenImpCasts(
+                     hasEitherOperand(
                          callExpr(callee(functionDecl(TimeConversionFunction())
                                              .bind("function_decl")))
-                             .bind("call")))))
+                             .bind("call")))
           .bind("binop"),
       this);
 }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D80499: Remove obsol... Stephen Kelly via Phabricator via cfe-commits

Reply via email to