summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp
diff options
context:
space:
mode:
authorDaniel Marjamaki <daniel.marjamaki@evidente.se>2016-11-21 14:29:53 +0000
committerDaniel Marjamaki <daniel.marjamaki@evidente.se>2016-11-21 14:29:53 +0000
commitae66045705bf62ee881848b1bc9b28178b2176c8 (patch)
treee85aa87c62f2ba925762aae13eb84c3a4c8244f1 /clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp
parent35369c1eb6c4066a563c5a1766c5fb449dc85eb5 (diff)
downloadbcm5719-llvm-ae66045705bf62ee881848b1bc9b28178b2176c8.tar.gz
bcm5719-llvm-ae66045705bf62ee881848b1bc9b28178b2176c8.zip
readability-redundant-declaration: Fix crash
Differential Revision: https://reviews.llvm.org/D26911 llvm-svn: 287540
Diffstat (limited to 'clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp
index ea7d8168ad4..10ba12295d5 100644
--- a/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/RedundantDeclarationCheck.cpp
@@ -28,6 +28,8 @@ void RedundantDeclarationCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Prev = D->getPreviousDecl();
if (!Prev)
return;
+ if (!Prev->getLocation().isValid())
+ return;
if (Prev->getLocation() == D->getLocation())
return;
OpenPOWER on IntegriCloud