xref: /aosp_15_r20/external/clang/test/Parser/namespaces.cpp (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
2*67e74705SXin Li 
3*67e74705SXin Li // PR6596
4*67e74705SXin Li namespace g { enum { o = 0 }; }
5*67e74705SXin Li 
foo()6*67e74705SXin Li void foo() {
7*67e74705SXin Li   namespace a { typedef g::o o; } // expected-error{{namespaces can only be defined in global or namespace scope}}
8*67e74705SXin Li }
9*67e74705SXin Li 
10*67e74705SXin Li // PR14085
11*67e74705SXin Li namespace PR14085 {}
12*67e74705SXin Li namespace = PR14085; // expected-error {{expected identifier}}
13*67e74705SXin Li 
14*67e74705SXin Li struct namespace_nested_in_record {
15*67e74705SXin Li   int k = ({namespace {}}); // expected-error {{statement expression not allowed at file scope}}
16*67e74705SXin Li };
17