Anders Carlsson | 8d7ba40 | 2009-03-28 06:23:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 3 | namespace N { }; |
| 4 | |
| 5 | namespace A = N; |
| 6 | |
| 7 | int B; // expected-note {{previous definition is here}} |
| 8 | namespace B = N; // expected-error {{redefinition of 'B' as different kind of symbol}} |
| 9 | |
| 10 | namespace C { } // expected-note {{previous definition is here}} |
| 11 | namespace C = N; // expected-error {{redefinition of 'C'}} |
Anders Carlsson | 5721c68 | 2009-03-28 06:42:02 +0000 | [diff] [blame] | 12 | |
| 13 | int i; |
| 14 | namespace D = i; // expected-error {{expected namespace name}} |
| 15 | |
| 16 | namespace E = N::Foo; // expected-error {{expected namespace name}} |
Anders Carlsson | a1a1b30 | 2009-03-28 07:51:31 +0000 | [diff] [blame] | 17 | |
| 18 | namespace F { |
| 19 | namespace A { namespace B { } } // expected-note {{candidate found by name lookup is 'F::A::B'}} |
| 20 | namespace B { } // expected-note {{candidate found by name lookup is 'F::B'}} |
| 21 | using namespace A; |
| 22 | namespace D = B; // expected-error {{reference to 'B' is ambiguous}} |
| 23 | } |
Anders Carlsson | dd729fc | 2009-03-28 23:49:35 +0000 | [diff] [blame^] | 24 | |
| 25 | namespace G { |
| 26 | namespace B = N; |
| 27 | } |