summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp b/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp
index 3fb5f5d9f0a..67c85a6728c 100644
--- a/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp
+++ b/clang-tools-extra/clang-tidy/llvm/TwineLocalCheck.cpp
@@ -35,8 +35,11 @@ void TwineLocalCheck::check(const MatchFinder::MatchResult &Result) {
// of the initializer.
const Expr *C = VD->getInit()->IgnoreImplicit();
- while (isa<CXXConstructExpr>(C))
+ while (isa<CXXConstructExpr>(C)) {
+ if (cast<CXXConstructExpr>(C)->getNumArgs() == 0)
+ break;
C = cast<CXXConstructExpr>(C)->getArg(0)->IgnoreParenImpCasts();
+ }
SourceRange TypeRange =
VD->getTypeSourceInfo()->getTypeLoc().getSourceRange();
OpenPOWER on IntegriCloud