summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaLookup.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-11-10 09:20:04 +0000
committerJohn McCall <rjmccall@apple.com>2009-11-10 09:20:04 +0000
commit9757d0363df04739892d177266fa3e7a2522c428 (patch)
treed6984d1372ef9c20a74d27844cf677e14916b7e2 /clang/lib/Sema/SemaLookup.cpp
parentdca0c284525b915df0fa147e2463ea80696c29e7 (diff)
downloadbcm5719-llvm-9757d0363df04739892d177266fa3e7a2522c428.tar.gz
bcm5719-llvm-9757d0363df04739892d177266fa3e7a2522c428.zip
Make a somewhat more convincing test case for unqualified lookup through
using directives, and fix a bug thereby exposed: since we're playing tricks with pointers, we need to make certain we're always using the same pointers for things. Also tweak an existing error message. llvm-svn: 86679
Diffstat (limited to 'clang/lib/Sema/SemaLookup.cpp')
-rw-r--r--clang/lib/Sema/SemaLookup.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaLookup.cpp b/clang/lib/Sema/SemaLookup.cpp
index f6ae4e147f7..eb7c3fa80e2 100644
--- a/clang/lib/Sema/SemaLookup.cpp
+++ b/clang/lib/Sema/SemaLookup.cpp
@@ -169,6 +169,7 @@ namespace {
DeclContext *Common = UD->getNominatedNamespace();
while (!Common->Encloses(EffectiveDC))
Common = Common->getParent();
+ Common = Common->getPrimaryContext();
list.push_back(UnqualUsingEntry(UD->getNominatedNamespace(), Common));
}
@@ -187,7 +188,7 @@ namespace {
std::pair<const_iterator,const_iterator>
getNamespacesFor(DeclContext *DC) const {
- return std::equal_range(begin(), end(), DC,
+ return std::equal_range(begin(), end(), DC->getPrimaryContext(),
UnqualUsingEntry::Comparator());
}
};
OpenPOWER on IntegriCloud