[PATCH] D18191: [clang-tidy] Add check for function parameters that are const& to builtin types
Richard via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 16 09:29:42 PDT 2016
LegalizeAdulthood added a subscriber: LegalizeAdulthood.
LegalizeAdulthood added a comment.
There is utility in the definition of a function in saying that an argument is `const int i` instead of `int i`. The const-ness declares the intent that this local variable is not going to be modified. However, there is that oddity in C++ that allows a declaration to say `void f(int i);` and the implementation to say `void f(const int i) { ... }`.
I think I would like the fixit to preserve the const-ness of the argument while still stripping it of it's reference.
http://reviews.llvm.org/D18191
More information about the cfe-commits
mailing list