xref: /llvm-project/clang/test/SemaCXX/namespace-alias.cpp (revision ac2c96528f0d753ae00955bbe65c9f41fe8ddd2f)
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'}}
12 
13 int i;
14 namespace D = i; // expected-error {{expected namespace name}}
15 
16 namespace E = N::Foo; // expected-error {{expected namespace name}}
17