From 325c7274809b637e86a8e81e7c78667d939440a8 Mon Sep 17 00:00:00 2001 From: Tim Shen Date: Tue, 21 Jun 2016 20:11:20 +0000 Subject: Fix clang-tidy patterns to adapt to newly added ExprWithCleanups nodes. Summary: This is a fix for the new ExprWithCleanups introduced by clang's temporary variable lifetime marks change. Reviewers: bkramer, sbenza, angelgarcia, alexth Subscribers: rsmith, cfe-commits Differential Revision: http://reviews.llvm.org/D21243 llvm-svn: 273310 --- clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp') diff --git a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp b/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp index 0d9c5ecd248..2f39f46e63f 100644 --- a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp @@ -33,7 +33,8 @@ void TwineLocalCheck::check(const MatchFinder::MatchResult &Result) { if (VD->hasInit()) { // Peel away implicit constructors and casts so we can see the actual type // of the initializer. - const Expr *C = VD->getInit(); + const Expr *C = VD->getInit()->IgnoreImplicit(); + while (isa(C)) C = cast(C)->getArg(0)->IgnoreParenImpCasts(); -- cgit v1.2.3