[PATCH] [clang-tidy] Add a checker for swapped literal arguments.

Benjamin Kramer benny.kra at gmail.com
Thu Jul 10 02:56:19 PDT 2014


Hi alexfh, djasper,

This looks for swapped arguments by looking at implicit conversions of
literal arguments

void Foo(int, double);
Foo(1.0, 3);  // Most likely a bug

We do this by checking that the same argument types exist in literals and
the declaration of the function.

http://reviews.llvm.org/D4457

Files:
  clang-tidy/misc/CMakeLists.txt
  clang-tidy/misc/ImplicitArgumentConversion.cpp
  clang-tidy/misc/ImplicitArgumentConversion.h
  clang-tidy/misc/MiscTidyModule.cpp
  test/clang-tidy/misc-implicit-argument-conversion.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4457.11256.patch
Type: text/x-patch
Size: 5242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140710/786800cf/attachment.bin>


More information about the cfe-commits mailing list