aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index a25204d808..0ad539ef17 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1605,19 +1605,6 @@ static void filterNonConflictingPreviousDecls(ASTContext &context,
if (previous.empty())
return;
- // If this declaration would have external linkage if it were the first
- // declaration of this name, then it may in fact be a redeclaration of
- // some hidden declaration, so include those too. We don't need to worry
- // about some previous visible declaration giving this declaration external
- // linkage, because in that case, we'll mark this declaration as a redecl
- // of the visible decl, and that decl will already be a redecl of the
- // hidden declaration if that's appropriate.
- //
- // Don't cache this linkage computation, because it's not yet correct: we
- // may later give this declaration a previous declaration which changes
- // its linkage.
- bool hasExternalLinkage = decl->hasExternalLinkageUncached();
-
LookupResult::Filter filter = previous.makeFilter();
while (filter.hasNext()) {
NamedDecl *old = filter.next();
@@ -1627,7 +1614,7 @@ static void filterNonConflictingPreviousDecls(ASTContext &context,
continue;
// If either has no-external linkage, ignore the old declaration.
- if (!hasExternalLinkage || old->getLinkage() != ExternalLinkage)
+ if (old->getLinkage() != ExternalLinkage || !decl->hasExternalLinkage())
filter.erase();
}