diff options
author | Haojian Wu <hokein@google.com> | 2016-11-08 00:45:34 +0000 |
---|---|---|
committer | Haojian Wu <hokein@google.com> | 2016-11-08 00:45:34 +0000 |
commit | c34fad4491eb8de9438e28bc302c37c7e459983d (patch) | |
tree | 7b4ad702cd7736ce4ef7e22d375cb6a66ccc4fcc /clang-tidy/performance | |
parent | 3cf515115e833b6d3eb1623486f9fb33049dc83c (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.cpp | 1 |
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( |