1// RUN: %check_clang_tidy %s misc-unused-parameters %t -- -- -Wno-strict-prototypes -xc
2
3// Basic removal
4// =============
5void a(int i) {;}
6// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: parameter 'i' is unused [misc-unused-parameters]
7// CHECK-FIXES: {{^}}void a(int i) {;}{{$}}
8
9static void b(); // In C, forward declarations can leave out parameters.
10static void b(int i) {;}
11// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: parameter 'i' is unused [misc-unused-parameters]
12// CHECK-FIXES: {{^}}static void b() {;}{{$}}
13
14// Unchanged cases
15// ===============
16void h(i, c, d) int i; char *c, *d; {} // Don't mess with K&R style
17
18// Do not warn on naked functions.
19__attribute__((naked)) void nakedFunction(int a, int b) { ; }
20

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