From 603ea2df2a997ade68a946cc5c203469a1b8f2c9 Mon Sep 17 00:00:00 2001 From: Felix Berger Date: Wed, 26 Jul 2017 00:45:41 +0000 Subject: [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 --- .../test/clang-tidy/performance-unnecessary-value-param.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp') 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 +void templateFunction(T) { +} + +template<> +void templateFunction(ExpensiveToCopyType E) { + // CHECK-MESSAGES: [[@LINE-1]]:64: warning: the parameter 'E' is copied + // CHECK-FIXES: void templateFunction(ExpensiveToCopyType E) { + E.constReference(); +} -- cgit v1.2.3