diff options
author | John McCall <rjmccall@apple.com> | 2009-10-10 05:48:19 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-10 05:48:19 +0000 |
commit | 6e24726524c2b51b31bb4b622aa678a46b024f42 (patch) | |
tree | 18635fadba59cf37262ebf36c8ad806ad0eb8bd2 /test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp | |
parent | eed3e699b581ad9e17f8147f26b882d20d65a317 (diff) |
Qualified lookup through using declarations. Diagnose a new type of ambiguity.
Split the various ambiguous result enumerators into their own enum. Tests
for most of C++ [namespace.qual].
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83700 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp')
-rw-r--r-- | test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp b/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp new file mode 100644 index 0000000000..7a51a7bb1d --- /dev/null +++ b/test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p3.cpp @@ -0,0 +1,41 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +// This is basically paraphrased from the standard. + +namespace Root { + int i = 0; + void f(); +} + +namespace A { + using namespace Root; +} + +namespace B { + using namespace Root; +} + +namespace AB { + using namespace A; + using namespace B; +} + +void test() { + if (AB::i) + AB::f(); +} + +namespace C { + using Root::i; + using Root::f; +} + +namespace AC { + using namespace A; + using namespace C; +} + +void test2() { + if (AC::i) + AC::f(); +} |