summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorIsmail Pazarbasi <ismail.pazarbasi@gmail.com>2014-03-06 21:48:45 +0000
committerIsmail Pazarbasi <ismail.pazarbasi@gmail.com>2014-03-06 21:48:45 +0000
commitbe19ae05e7dedc052d3b8314e74d6810f1ec7197 (patch)
tree6604563c9074576b71a5763adccd73ad1bce41ce /clang/lib/AST/Decl.cpp
parent02548c08f85393fac483fa66565d07ef38da9b01 (diff)
downloadbcm5719-llvm-be19ae05e7dedc052d3b8314e74d6810f1ec7197.tar.gz
bcm5719-llvm-be19ae05e7dedc052d3b8314e74d6810f1ec7197.zip
Exclude invalid old decl from mismatching linkage assertion
This patch fixes PR18964. In linkage computation, assertion fails when an old invalid declaration's linkage mismatches with the current decl's one. llvm-svn: 203168
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
-rw-r--r--clang/lib/AST/Decl.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp
index e362c730d40..db404ec5fe3 100644
--- a/clang/lib/AST/Decl.cpp
+++ b/clang/lib/AST/Decl.cpp
@@ -1243,8 +1243,7 @@ public:
// We have just computed the linkage for this decl. By induction we know
// that all other computed linkages match, check that the one we just
- // computed
- // also does.
+ // computed also does.
NamedDecl *Old = NULL;
for (NamedDecl::redecl_iterator I = D->redecls_begin(),
E = D->redecls_end();
@@ -1252,7 +1251,7 @@ public:
NamedDecl *T = cast<NamedDecl>(*I);
if (T == D)
continue;
- if (T->hasCachedLinkage()) {
+ if (!T->isInvalidDecl() && T->hasCachedLinkage()) {
Old = T;
break;
}
OpenPOWER on IntegriCloud