From b73b5cda620a375ce0ca3c5d0a9bbe4176cada59 Mon Sep 17 00:00:00 2001 From: Bruno Ricci Date: Sun, 17 Feb 2019 18:21:54 +0000 Subject: [PATCH] [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. llvm-svn: 354228 --- .../clang-tidy/bugprone/DanglingHandleCheck.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp index 9cefc20f6fb9..74ad2e7535fc 100644 --- a/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/DanglingHandleCheck.cpp @@ -163,9 +163,8 @@ void DanglingHandleCheck::registerMatchersForReturn(MatchFinder *Finder) { // 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); }