Add an argument comment checker to clang-tidy.
This checks that parameters named in comments that appear before arguments in function and constructor calls match the parameter name used in the callee's declaration. For example: void f(int x, int y); void g() { f(/*y=*/0, /*z=*/0); } contains two violations of the policy, as the names 'x' and 'y' used in the declaration do not match names 'y' and 'z' used at the call site. I think there is significant value in being able to check/enforce this policy as a way of guarding against accidental API misuse and silent breakages caused by API changes. Although this pattern appears somewhat frequently in the LLVM codebase, this policy is not prescribed by the LLVM coding standards at the moment, so it lives under 'misc'. Differential Revision: http://llvm-reviews.chandlerc.com/D2914 llvm-svn: 204113
Loading
Please register or sign in to comment