1// RUN: %check_clang_tidy %s misc-unused-parameters %t -- \
2// RUN: -config="{CheckOptions: {StrictMode: true}}" --
3
4// Warn on empty function bodies in StrictMode.
5namespace strict_mode {
6void f(int foo) {}
7// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: parameter 'foo' is unused [misc-unused-parameters]
8// CHECK-FIXES: {{^}}void f(int /*foo*/) {}{{$}}
9class E {
10 int i;
11
12public:
13 E(int j) {}
14// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: parameter 'j' is unused
15// CHECK-FIXES: {{^}} E(int /*j*/) {}{{$}}
16};
17class F {
18 int i;
19
20public:
21 F(int j) : i() {}
22// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: parameter 'j' is unused
23// CHECK-FIXES: {{^}} F(int /*j*/) : i() {}{{$}}
24};
25
26// Do not warn on naked functions.
27[[gnu::naked]] int nakedFunction(int a, float b, const char *c) { ; }
28__attribute__((naked)) void nakedFunction(int a, int b) { ; }
29}
30

source code of clang-tools-extra/test/clang-tidy/checkers/misc/unused-parameters-strict.cpp