2015-10-22 22:54:50 +08:00
|
|
|
// RUN: %check_clang_tidy %s misc-unused-parameters %t -- -- -xc
|
2015-08-10 23:45:46 +08:00
|
|
|
|
|
|
|
// Basic removal
|
|
|
|
// =============
|
|
|
|
void a(int i) {}
|
|
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:12: warning: parameter 'i' is unused [misc-unused-parameters]
|
|
|
|
// CHECK-FIXES: {{^}}void a(int /*i*/) {}{{$}}
|
|
|
|
|
2015-08-14 21:39:57 +08:00
|
|
|
static void b(); // In C, forward declarations can leave out parameters.
|
|
|
|
static void b(int i) {}
|
|
|
|
// CHECK-MESSAGES: :[[@LINE-1]]:19: warning: parameter 'i' is unused [misc-unused-parameters]
|
|
|
|
// CHECK-FIXES: {{^}}static void b() {}{{$}}
|
|
|
|
|
2015-08-10 23:45:46 +08:00
|
|
|
// Unchanged cases
|
|
|
|
// ===============
|
|
|
|
void h(i, c, d) int i; char *c, *d; {} // Don't mess with K&R style
|
|
|
|
|