aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-04-13 00:20:21 +0000
committerJohn McCall <rjmccall@apple.com>2013-04-13 00:20:21 +0000
commit927b0af2f0834bad37e3d2a1953804b0845d8711 (patch)
treeefcad78c36474cbb5b3ec7fd841f029dc0f20d19 /lib/Sema/SemaDecl.cpp
parentdd9bd3ba42ecc3c91ba36f194b993a99371ab825 (diff)
Don't replace an existing decl in the scope chains with its
local-extern redeclaration; type refinements, default arguments, etc. must all be locally scoped. rdar://13535367 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 6dfc86f501..a2c3c2e147 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -4328,34 +4328,6 @@ Sema::RegisterLocallyScopedExternCDecl(NamedDecl *ND,
"Decl is not a locally-scoped decl!");
// Note that we have a locally-scoped external with this name.
LocallyScopedExternCDecls[ND->getDeclName()] = ND;
-
- if (!Previous.isSingleResult())
- return;
-
- NamedDecl *PrevDecl = Previous.getFoundDecl();
-
- // If there was a previous declaration of this entity, it may be in
- // our identifier chain. Update the identifier chain with the new
- // declaration.
- if (S && IdResolver.ReplaceDecl(PrevDecl, ND)) {
- // The previous declaration was found on the identifer resolver
- // chain, so remove it from its scope.
-
- if (S->isDeclScope(PrevDecl)) {
- // Special case for redeclarations in the SAME scope.
- // Because this declaration is going to be added to the identifier chain
- // later, we should temporarily take it OFF the chain.
- IdResolver.RemoveDecl(ND);
-
- } else {
- // Find the scope for the original declaration.
- while (S && !S->isDeclScope(PrevDecl))
- S = S->getParent();
- }
-
- if (S)
- S->RemoveDecl(PrevDecl);
- }
}
llvm::DenseMap<DeclarationName, NamedDecl *>::iterator