aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/performance
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2016-11-08 00:45:34 +0000
committerHaojian Wu <hokein@google.com>2016-11-08 00:45:34 +0000
commitc34fad4491eb8de9438e28bc302c37c7e459983d (patch)
tree7b4ad702cd7736ce4ef7e22d375cb6a66ccc4fcc /clang-tidy/performance
parent3cf515115e833b6d3eb1623486f9fb33049dc83c (diff)
[clang-tidy] Don't warn implicit variables in peformance-unnecessary-copy-initialization.
Summary: This will prevent the check warning the variables which have been implicitly added by compiler, like the following case (in for-range loop): the variable '__end' is copy-constructed from a const reference... Reviewers: alexfh Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25911 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@286186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/performance')
-rw-r--r--clang-tidy/performance/UnnecessaryCopyInitialization.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang-tidy/performance/UnnecessaryCopyInitialization.cpp b/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
index e4863509..66773a65 100644
--- a/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
+++ b/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
@@ -57,6 +57,7 @@ void UnnecessaryCopyInitialization::registerMatchers(MatchFinder *Finder) {
declStmt(
has(varDecl(hasLocalStorage(),
hasType(matchers::isExpensiveToCopy()),
+ unless(isImplicit()),
hasInitializer(
cxxConstructExpr(
hasDeclaration(cxxConstructorDecl(