1// RUN: %check_clang_tidy %s readability-non-const-parameter %t
2
3static int f();
4
5int f(p)
6 int *p;
7// CHECK-MESSAGES: :[[@LINE-1]]:8: warning: pointer parameter 'p' can be pointer to const [readability-non-const-parameter]
8// CHECK-FIXES: {{^}} const int *p;{{$}}
9{
10 return *p;
11}
12

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of clang-tools-extra/test/clang-tidy/checkers/readability/non-const-parameter.c