summaryrefslogtreecommitdiffstats
path: root/clang/lib
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
commita4da323ee0696732691380ad6010a53495f9512b (patch)
tree1c4ba2083983466fc58f8bdac40741014bd1bc20 /clang/lib
parent50b8b5507b345bc95111ed7f1e11036e3a849ac1 (diff)
downloadbcm5719-llvm-a4da323ee0696732691380ad6010a53495f9512b.tar.gz
bcm5719-llvm-a4da323ee0696732691380ad6010a53495f9512b.zip
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 llvm-svn: 179430
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6dfc86f5010..a2c3c2e1472 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud