[PATCH] D12462: [PATCH] [clang-tidy] Add inconsistent declaration parameter name check

Piotr Dziwinski via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 31 13:16:07 PDT 2015


piotrdz marked an inline comment as done.
piotrdz added a comment.

Now this issue with templates is a bit difficult for me. I tried everything that seems to have made sense, but I still get output like this:

  /work/clang-trunk/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp:47:6: warning: function 'templateFunction' has other declaration with different parameter name [readability-inconsistent-declaration-parameter-name]
  void templateFunction(float b)
       ^
  /work/clang-trunk/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp:47:6: note: other declaration seen here
  void templateFunction(float b)
       ^
  /work/clang-trunk/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp:47:29: note: parameter 1 is named 'b' here, but 'a' in other declaration
  void templateFunction(float b)
                              ^

But I'd like to get output like this:

  /work/clang-trunk/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp:47:6: warning: function 'templateFunction<float>' has other declaration with different parameter name [readability-inconsistent-declaration-parameter-name]
  void templateFunction(float b)
       ^
  /work/clang-trunk/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp:47:6: note: other declaration seen here
  void templateFunction(T a);
       ^
  /work/clang-trunk/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp:47:29: note: parameter 1 is named 'b' here, but 'a' in other declaration
  void templateFunction(float b)
                              ^


http://reviews.llvm.org/D12462





More information about the cfe-commits mailing list