danielmarjamaki marked 10 inline comments as done. ================ Comment at: test/clang-tidy/readability-non-const-parameter.cpp:117-135 @@ +116,21 @@ +// CHECK-MESSAGES: :[[@LINE+1]]:18: warning: pointer parameter 'p' can be +int return1(int *p) { + // CHECK-FIXES: {{^}}int return1(const int *p) {{{$}} + return *p; +} + +// CHECK-MESSAGES: :[[@LINE+1]]:25: warning: pointer parameter 'p' can be +const int *return2(int *p) { + // CHECK-FIXES: {{^}}const int *return2(const int *p) {{{$}} + return p; +} + +// CHECK-MESSAGES: :[[@LINE+1]]:25: warning: pointer parameter 'p' can be +const int *return3(int *p) { + // CHECK-FIXES: {{^}}const int *return3(const int *p) {{{$}} + return p + 1; +} + +// CHECK-MESSAGES: :[[@LINE+1]]:27: warning: pointer parameter 'p' can be +const char *return4(char *p) { + // CHECK-FIXES: {{^}}const char *return4(const char *p) {{{$}} ---------------- I have changed the message now. pointer parameter 'p' can be pointer to const
The name is the same. Do you think it would be better with PointerParameterConstnessCheck() perhaps? https://reviews.llvm.org/D15332 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits