xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/bugprone/argument-comment-strict.cpp (revision 222dd235ffc39b3695a3c002593097bec216a8fa)
189a1d03eSRichard // RUN: %check_clang_tidy %s bugprone-argument-comment %t -- \
2*222dd235SCongcong Cai // RUN:   -config="{CheckOptions: {bugprone-argument-comment.StrictMode: true}}" --
389a1d03eSRichard 
489a1d03eSRichard void f(int _with_underscores_);
589a1d03eSRichard void g(int x_);
689a1d03eSRichard void ignores_underscores() {
789a1d03eSRichard   f(/*With_Underscores=*/0);
889a1d03eSRichard // CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'With_Underscores' in comment does not match parameter name '_with_underscores_'
989a1d03eSRichard // CHECK-NOTES: [[@LINE-5]]:12: note: '_with_underscores_' declared here
1089a1d03eSRichard // CHECK-FIXES: f(/*_with_underscores_=*/0);
1189a1d03eSRichard 
1289a1d03eSRichard   f(/*with_underscores=*/1);
1389a1d03eSRichard // CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'with_underscores' in comment does not match parameter name '_with_underscores_'
1489a1d03eSRichard // CHECK-NOTES: [[@LINE-10]]:12: note: '_with_underscores_' declared here
1589a1d03eSRichard // CHECK-FIXES: f(/*_with_underscores_=*/1);
1689a1d03eSRichard   f(/*_With_Underscores_=*/2);
1789a1d03eSRichard // CHECK-NOTES: [[@LINE-1]]:5: warning: argument name '_With_Underscores_' in comment does not match parameter name '_with_underscores_'
1889a1d03eSRichard // CHECK-NOTES: [[@LINE-14]]:12: note: '_with_underscores_' declared here
1989a1d03eSRichard // CHECK-FIXES: f(/*_with_underscores_=*/2);
2089a1d03eSRichard   g(/*X=*/3);
2189a1d03eSRichard // CHECK-NOTES: [[@LINE-1]]:5: warning: argument name 'X' in comment does not match parameter name 'x_'
2289a1d03eSRichard // CHECK-NOTES: [[@LINE-17]]:12: note: 'x_' declared here
2389a1d03eSRichard // CHECK-FIXES: g(/*x_=*/3);
2489a1d03eSRichard }
25