diff options
author | Tim Shen <timshen91@gmail.com> | 2016-06-21 20:11:20 +0000 |
---|---|---|
committer | Tim Shen <timshen91@gmail.com> | 2016-06-21 20:11:20 +0000 |
commit | 325c7274809b637e86a8e81e7c78667d939440a8 (patch) | |
tree | fee29116dba10672bf21056fc5fdf9d145f7c099 /clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp | |
parent | 8b65f102cd4c5a066195de00379f74411d8c7fcb (diff) | |
download | bcm5719-llvm-325c7274809b637e86a8e81e7c78667d939440a8.tar.gz bcm5719-llvm-325c7274809b637e86a8e81e7c78667d939440a8.zip |
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
Diffstat (limited to 'clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<CXXConstructExpr>(C)) C = cast<CXXConstructExpr>(C)->getArg(0)->IgnoreParenImpCasts(); |