diff options
author | Miklos Vajna <vmiklos@vmiklos.hu> | 2018-01-05 23:22:10 +0000 |
---|---|---|
committer | Miklos Vajna <vmiklos@vmiklos.hu> | 2018-01-05 23:22:10 +0000 |
commit | 063e6cc5e70623ee1015912d7d5c4071b586c524 (patch) | |
tree | d722b572096fc7a11e24e686b9377a187604d355 /clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp | |
parent | e2659d83834d5e9e61aecf4119c9842a4e4efe18 (diff) | |
download | bcm5719-llvm-063e6cc5e70623ee1015912d7d5c4071b586c524.tar.gz bcm5719-llvm-063e6cc5e70623ee1015912d7d5c4071b586c524.zip |
clang-tidy: add IgnoreMacros option to readability-inconsistent-declaration-parameter-name
And also enable it by default to be consistent with e.g. modernize-use-using.
This helps e.g. when running this check on client code where the macro is
provided by the system, so there is no easy way to modify it.
Reviewers: alexfh, piotrdz, hokein, ilya-biryukov
Reviewed By: alexfh
Differential Revision: https://reviews.llvm.org/D41716
llvm-svn: 321913
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp index d2c2d7d7054..43412f528fe 100644 --- a/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp +++ b/clang-tools-extra/test/clang-tidy/readability-inconsistent-declaration-parameter-name.cpp @@ -178,11 +178,14 @@ void Class::memberFunctionTemplateWithSpecializations(float c) { c; } ////////////////////////////////////////////////////// -#define DECLARE_FUNCTION_WITH_PARAM_NAME(function_name, param_name) \ - void function_name(int param_name) - -// CHECK-MESSAGES: :[[@LINE+1]]:34: warning: function 'macroFunction' has 1 other declaration with different parameter names [readability-inconsistent-declaration-parameter-name] -DECLARE_FUNCTION_WITH_PARAM_NAME(macroFunction, a); -// CHECK-MESSAGES: :[[@LINE+2]]:34: note: the 1st inconsistent declaration seen here -// CHECK-MESSAGES: :[[@LINE+1]]:34: note: differing parameters are named here: ('b'), in the other declaration: ('a') -DECLARE_FUNCTION_WITH_PARAM_NAME(macroFunction, b); +// This resulted in a warning by default. +#define MACRO() \ + void f(int x); + +struct S { + MACRO(); +}; + +void S::f(int y) +{ +} |