Douglas Gregor | f780abc | 2008-12-30 03:27:21 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | class A {}; |
| 4 | |
| 5 | namespace B { |
| 6 | namespace A {} |
| 7 | using namespace A ; |
| 8 | } |
| 9 | |
| 10 | namespace C {} |
| 11 | |
| 12 | namespace D { |
| 13 | |
| 14 | class C { |
| 15 | |
| 16 | using namespace B ; // expected-error{{expected unqualified-id}} |
| 17 | //FIXME: this needs better error message |
| 18 | }; |
| 19 | |
| 20 | namespace B {} |
| 21 | |
| 22 | using namespace C ; |
| 23 | using namespace B::A ; // expected-error{{expected namespace name}} |
| 24 | //FIXME: would be nice to note, that A is not member of D::B |
| 25 | using namespace ::B::A ; |
| 26 | using namespace ::D::C ; // expected-error{{expected namespace name}} |
| 27 | } |
| 28 | |
| 29 | using namespace ! ; // expected-error{{expected namespace name}} |
| 30 | using namespace A ; // expected-error{{expected namespace name}} |
Chris Lattner | 823c44e | 2009-01-06 07:27:21 +0000 | [diff] [blame] | 31 | using namespace ::A // expected-error{{expected namespace name}} |
| 32 | B ; // expected-error{{expected ';' after namespace name}} |
Douglas Gregor | f780abc | 2008-12-30 03:27:21 +0000 | [diff] [blame] | 33 | |
Douglas Gregor | eb11cd0 | 2009-01-14 22:20:51 +0000 | [diff] [blame] | 34 | void test_nslookup() { |
| 35 | int B; |
| 36 | class C; |
| 37 | using namespace B; |
| 38 | using namespace C; |
| 39 | } |
| 40 | |