1 // RUN: %check_clang_tidy %s misc-unused-parameters %t -- -- -xc
2
3 // Basic removal
4 // =============
a(int i)5 void 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
9 static void b(); // In C, forward declarations can leave out parameters.
b(int i)10 static 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 // ===============
h(i,c,d)16 void h(i, c, d) int i; char *c, *d; {} // Don't mess with K&R style
17
18