[clang-tools-extra] r354228 - [clang-tidy][NFCI] DanglingHandleCheck: Remove a superflous IgnoreParenImpCasts

Bruno Ricci via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 17 10:21:54 PST 2019


Author: brunoricci
Date: Sun Feb 17 10:21:54 2019
New Revision: 354228

URL: http://llvm.org/viewvc/llvm-project?rev=354228&view=rev
Log:
[clang-tidy][NFCI] DanglingHandleCheck: Remove a superflous IgnoreParenImpCasts

ExprWithCleanups is currently not skipped by IgnoreParenImpCasts, but is skipped
by IgnoreImpCasts. In view of fixing this inconsistency in D57267, remove the
IgnoreParenImpCasts between the ReturnStmt and the ExprWithCleanups which
is not needed since ExprWithCleanups is always created as a direct child of
ReturnStmt (by inspection of each ReturnStmt::Create in Sema/SemaStmt.cpp).

NFC intended.


Modified:
    clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp

Modified: clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp?rev=354228&r1=354227&r2=354228&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/bugprone/DanglingHandleCheck.cpp Sun Feb 17 10:21:54 2019
@@ -163,9 +163,8 @@ void DanglingHandleCheck::registerMatche
 
   // Return a temporary.
   Finder->addMatcher(
-      returnStmt(
-          has(ignoringParenImpCasts(exprWithCleanups(has(ignoringParenImpCasts(
-              handleFrom(IsAHandle, handleFromTemporaryValue(IsAHandle))))))))
+      returnStmt(has(exprWithCleanups(has(ignoringParenImpCasts(handleFrom(
+                     IsAHandle, handleFromTemporaryValue(IsAHandle)))))))
           .bind("bad_stmt"),
       this);
 }




More information about the cfe-commits mailing list