diff options
author | Felix Berger <flx@google.com> | 2017-07-26 00:45:41 +0000 |
---|---|---|
committer | Felix Berger <flx@google.com> | 2017-07-26 00:45:41 +0000 |
commit | 603ea2df2a997ade68a946cc5c203469a1b8f2c9 (patch) | |
tree | 49efd2bbd7bdddaeddbaaa48aee33f7b0d6f455e /clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp | |
parent | 14d90fd05cbed5fd3fcee492f072a4e5816f20b5 (diff) | |
download | bcm5719-llvm-603ea2df2a997ade68a946cc5c203469a1b8f2c9.tar.gz bcm5719-llvm-603ea2df2a997ade68a946cc5c203469a1b8f2c9.zip |
[clang-tidy] Do not issue fixit for explicit template specializations
Summary:
Do not issue fixit in UnnecessaryValueParamCheck if the function is an explicit template specialization as this could cause build breakages.
Reviewers: alexfh
Subscribers: JDevlieghere, xazax.hun, cfe-commits
Differential Revision: https://reviews.llvm.org/D35718
llvm-svn: 309067
Diffstat (limited to 'clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp index 5491cbb80c0..dcf82df2e38 100644 --- a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp +++ b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp @@ -348,3 +348,14 @@ void fun() { ExpensiveToCopyType E; NegativeUsingConstructor S(E); } + +template<typename T> +void templateFunction(T) { +} + +template<> +void templateFunction<ExpensiveToCopyType>(ExpensiveToCopyType E) { + // CHECK-MESSAGES: [[@LINE-1]]:64: warning: the parameter 'E' is copied + // CHECK-FIXES: void templateFunction<ExpensiveToCopyType>(ExpensiveToCopyType E) { + E.constReference(); +} |