aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-05-06 23:32:38 +0000
committerDouglas Gregor <dgregor@apple.com>2011-05-06 23:32:38 +0000
commit5cb0ef4aed9a4a1741260e16a99d18682335ab9b (patch)
tree73089b06f47f5e2b097783614f599e69c6e40ad4 /lib/AST/DeclBase.cpp
parent010157f9dbce11706c96229cf17f1da9e2a39d73 (diff)
Implement a minor optimization by not introducing declarations into
DeclContext's lookup table when they aren't in any identifier namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 8f3388ee58..1766d39c14 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -1166,10 +1166,10 @@ void DeclContext::makeDeclVisibleInContextImpl(NamedDecl *D) {
if (!D->getDeclName())
return;
- // FIXME: This feels like a hack. Should DeclarationName support
- // template-ids, or is there a better way to keep specializations
- // from being visible?
- if (isa<ClassTemplateSpecializationDecl>(D) || D->isTemplateParameter())
+ // Skip entities that can't be found by name lookup into a particular
+ // context.
+ if ((D->getIdentifierNamespace() == 0 && !isa<UsingDirectiveDecl>(D)) ||
+ D->isTemplateParameter())
return;
ASTContext *C = 0;