1 | // RUN: %check_clang_tidy %s google-readability-namespace-comments %t \ |
---|---|
2 | // RUN: -config='{CheckOptions: { \ |
3 | // RUN: google-readability-namespace-comments.AllowOmittingNamespaceComments: true, \ |
4 | // RUN: google-readability-namespace-comments.ShortNamespaceLines: 0, \ |
5 | // RUN: }}' |
6 | |
7 | // accept if namespace comments are fully omitted |
8 | namespace n1 { |
9 | namespace /* a comment */ n2 /* another comment */ { |
10 | void f(); |
11 | }} |
12 | |
13 | #define MACRO macro_expansion |
14 | namespace MACRO { |
15 | void f(); |
16 | } |
17 | |
18 | namespace [[deprecated("foo")]] namespace_with_attr { |
19 | inline namespace inline_namespace { |
20 | void f(); |
21 | } |
22 | } |
23 | |
24 | namespace [[]] { |
25 | void f(); |
26 | } |
27 | |
28 | // accept if namespace comments are partly omitted (e.g. only for nested namespace) |
29 | namespace n3 { |
30 | namespace n4 { |
31 | void f(); |
32 | } // n4 |
33 | } |
34 | |
35 | // fail if namespace comment is different than expected |
36 | namespace n1 { |
37 | void f(); |
38 | } // namespace n2 |
39 | // CHECK-MESSAGES: :[[@LINE-1]]:2: warning: namespace 'n1' ends with a comment that refers to a wrong namespace 'n2' [google-readability-namespace-comments] |
40 | |
41 |