aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-tidy/checkers/readability/non-const-parameter.c
blob: c5ddf034d6e4eac15d92c185def6abf0f2c5edb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: %check_clang_tidy -std=c99,c11,c17 %s readability-non-const-parameter %t

static int f();

int f(p)
  int *p;
// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: pointer parameter 'p' can be pointer to const [readability-non-const-parameter]
// CHECK-FIXES: const int *p;
{
    return *p;
}