aboutsummaryrefslogtreecommitdiff
path: root/clang-tidy/utils
diff options
context:
space:
mode:
authorFelix Berger <flx@google.com>2016-11-04 20:29:22 +0000
committerFelix Berger <flx@google.com>2016-11-04 20:29:22 +0000
commit9db711c3358335e494f3bc0b4e66a03e46f0d805 (patch)
tree10c3225f99a1e60c661e70e52866ce96f89522af /clang-tidy/utils
parent34c7f21a0b574690e50fc3d91ad251e4fc9f6f05 (diff)
[clang-tidy] Ignore incomplete types when determining whether they are expensive to copy
Summary: IsExpensiveToCopy can return false positives for incomplete types, so ignore them. All existing ClangTidy tests that depend on this function still pass as the types are complete. Reviewers: alexfh, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26195 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@286008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'clang-tidy/utils')
-rw-r--r--clang-tidy/utils/TypeTraits.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tidy/utils/TypeTraits.cpp b/clang-tidy/utils/TypeTraits.cpp
index 03b05d19..88e4a829 100644
--- a/clang-tidy/utils/TypeTraits.cpp
+++ b/clang-tidy/utils/TypeTraits.cpp
@@ -41,7 +41,7 @@ bool hasDeletedCopyConstructor(QualType Type) {
llvm::Optional<bool> isExpensiveToCopy(QualType Type,
const ASTContext &Context) {
- if (Type->isDependentType())
+ if (Type->isDependentType() || Type->isIncompleteType())
return llvm::None;
return !Type.isTriviallyCopyableType(Context) &&
!classHasTrivialCopyAndDestroy(Type) &&