xref: /llvm-project/clang/test/Parser/namespace-attributes.cpp (revision 1a73654b3212b623ac21b9deb3aeaadc6906b7e4)
1 // RUN: %clang_cc1 -std=c++17 -verify %s
2 
3 namespace __attribute__(()) A
4 {
5 }
6 
7 namespace A __attribute__(()) [[]] // expected-error {{an attribute list cannot appear here}}
8 {
9 }
10 
11 namespace A [[]] __attribute__(()) // expected-error {{an attribute list cannot appear here}}
12 {
13 }
14 
15 namespace [[]] A __attribute__(())
16 {
17 }
18 
19 namespace [[]] __attribute__(()) A
20 {
21 }
22 
23 namespace __attribute__(()) [[]] A
24 {
25 }
26 
27 namespace __attribute__(()) A [[]] // expected-error {{an attribute list cannot appear here}}
28 {
29 }
30 
31 namespace A::B __attribute__(()) // expected-error {{attributes cannot be specified on a nested namespace definition}}
32 {
33 }
34 
35 namespace __attribute__(()) A::B // expected-error {{attributes cannot be specified on a nested namespace definition}}
36 {
37 }
38