blob: 87e8b2c5ddd154668d681ba3317f27bd72ef3ca9 [file] [log] [blame]
Anders Carlsson8d7ba402009-03-28 06:23:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
2
3namespace N { };
4
5namespace A = N;
6
7int B; // expected-note {{previous definition is here}}
8namespace B = N; // expected-error {{redefinition of 'B' as different kind of symbol}}
9
10namespace C { } // expected-note {{previous definition is here}}
11namespace C = N; // expected-error {{redefinition of 'C'}}
Anders Carlsson5721c682009-03-28 06:42:02 +000012
13int i;
14namespace D = i; // expected-error {{expected namespace name}}
15
16namespace E = N::Foo; // expected-error {{expected namespace name}}
Anders Carlssona1a1b302009-03-28 07:51:31 +000017
18namespace 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 Carlssondd729fc2009-03-28 23:49:35 +000024
25namespace G {
26 namespace B = N;
27}