summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/cxx-using-directive.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-01-14 22:20:51 +0000
committerDouglas Gregor <dgregor@apple.com>2009-01-14 22:20:51 +0000
commit34074326449e1e6b7de77a4c9a0d78ea4b54ca64 (patch)
tree7c12b76899ad12bfb4002dd8b72e5294a8a3f9a3 /clang/test/Parser/cxx-using-directive.cpp
parent8fb9480ed26693dc8f8053b6345bdd188041d41b (diff)
downloadbcm5719-llvm-34074326449e1e6b7de77a4c9a0d78ea4b54ca64.tar.gz
bcm5719-llvm-34074326449e1e6b7de77a4c9a0d78ea4b54ca64.zip
Refactor name lookup.
This change refactors and cleans up our handling of name lookup with LookupDecl. There are several aspects to this refactoring: - The criteria for name lookup is now encapsulated into the class LookupCriteria, which replaces the hideous set of boolean values that LookupDecl currently has. - The results of name lookup are returned in a new class LookupResult, which can lazily build OverloadedFunctionDecls for overloaded function sets (and, eventually, eliminate the need to allocate member for OverloadedFunctionDecls) and contains a placeholder for handling ambiguous name lookup (for C++). - The primary entry points for name lookup are now LookupName (for unqualified name lookup) and LookupQualifiedName (for qualified name lookup). There is also a convenience function LookupParsedName that handles qualified/unqualified name lookup when given a scope specifier. Together, these routines are meant to gradually replace the kludgy LookupDecl, but this won't happen until after we have base class lookup (which forces us to cope with ambiguities). - Documented the heck out of name lookup. Experimenting a little with using Doxygen's member groups to make some sense of the Sema class. Feedback welcome! - Fixes some lingering issues with name lookup for nested-name-specifiers, which now goes through LookupName/LookupQualifiedName. llvm-svn: 62245
Diffstat (limited to 'clang/test/Parser/cxx-using-directive.cpp')
-rw-r--r--clang/test/Parser/cxx-using-directive.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-using-directive.cpp b/clang/test/Parser/cxx-using-directive.cpp
index 73f1e002c2d..2ee014e54f4 100644
--- a/clang/test/Parser/cxx-using-directive.cpp
+++ b/clang/test/Parser/cxx-using-directive.cpp
@@ -31,3 +31,10 @@ using namespace A ; // expected-error{{expected namespace name}}
using namespace ::A // expected-error{{expected namespace name}}
B ; // expected-error{{expected ';' after namespace name}}
+void test_nslookup() {
+ int B;
+ class C;
+ using namespace B;
+ using namespace C;
+}
+
OpenPOWER on IntegriCloud