brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.5 KiB · d555b87 Raw
116 lines · cpp
1// RUN: %check_clang_tidy %s google-readability-namespace-comments %t2 3namespace n1 {4namespace /* a comment */ n2 /* another comment */ {5 6 7void f(); // So that the namespace isn't empty.8 9 10// CHECK-MESSAGES: :[[@LINE+4]]:1: warning: namespace 'n2' not terminated with a closing comment [google-readability-namespace-comments]11// CHECK-MESSAGES: :[[@LINE-7]]:27: note: namespace 'n2' starts here12// CHECK-MESSAGES: :[[@LINE+2]]:2: warning: namespace 'n1' not terminated with13// CHECK-MESSAGES: :[[@LINE-10]]:11: note: namespace 'n1' starts here14}}15// CHECK-FIXES: }  // namespace n216// CHECK-FIXES: }  // namespace n117 18#define MACRO macro_expansion19namespace MACRO {20void f(); // So that the namespace isn't empty.21// 122// 223// 324// 425// 526// 627// 728// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: namespace 'MACRO' not terminated with29// CHECK-MESSAGES: :[[@LINE-10]]:11: note: namespace 'MACRO' starts here30}31// CHECK-FIXES: }  // namespace MACRO32 33namespace macro_expansion {34void ff(); // So that the namespace isn't empty.35// 136// 237// 338// 439// 540// 641// 742// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: namespace 'macro_expansion' not terminated with43// CHECK-MESSAGES: :[[@LINE-10]]:11: note: namespace 'macro_expansion' starts here44}45// CHECK-FIXES: }  // namespace macro_expansion46 47namespace [[deprecated("foo")]] namespace_with_attr {48inline namespace inline_namespace {49void g();50// 151// 252// 353// 454// 555// 656// 757// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: namespace 'inline_namespace' not terminated with58// CHECK-MESSAGES: :[[@LINE-10]]:18: note: namespace 'inline_namespace' starts here59}60// CHECK-FIXES: }  // namespace inline_namespace61// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: namespace 'namespace_with_attr' not terminated with62// CHECK-MESSAGES: :[[@LINE-15]]:33: note: namespace 'namespace_with_attr' starts here63}64// CHECK-FIXES: }  // namespace namespace_with_attr65 66namespace [[deprecated]] {67void h();68// 169// 270// 371// 472// 573// 674// 775// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: anonymous namespace not terminated with76// CHECK-MESSAGES: :[[@LINE-10]]:26: note: anonymous namespace starts here77}78// CHECK-FIXES: }  // namespace79 80namespace [[]] {81void hh();82// 183// 284// 385// 486// 587// 688// 789// CHECK-MESSAGES: :[[@LINE+2]]:1: warning: anonymous namespace not terminated with90// CHECK-MESSAGES: :[[@LINE-10]]:16: note: anonymous namespace starts here91}92// CHECK-FIXES: }  // namespace93 94namespace short1 {95namespace short2 {96// Namespaces covering 10 lines or fewer are exempt from this rule.97 98 99 100 101 102}103}104 105namespace n3 {106 107 108 109 110 111 112 113 114 115}; // namespace n3116