summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/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
commit393803328252836581bc2a2fd0c01a577fa986b8 (patch)
treeec10c4d6439fafc8f7f1b8019c41ac1320af2a67 /clang-tools-extra/clang-tidy/utils
parent0f901c7ec4a39f07fd6b942839b669506e3247fb (diff)
downloadbcm5719-llvm-393803328252836581bc2a2fd0c01a577fa986b8.tar.gz
bcm5719-llvm-393803328252836581bc2a2fd0c01a577fa986b8.zip
[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 llvm-svn: 286008
Diffstat (limited to 'clang-tools-extra/clang-tidy/utils')
-rw-r--r--clang-tools-extra/clang-tidy/utils/TypeTraits.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang-tools-extra/clang-tidy/utils/TypeTraits.cpp b/clang-tools-extra/clang-tidy/utils/TypeTraits.cpp
index 03b05d19632..88e4a829bdb 100644
--- a/clang-tools-extra/clang-tidy/utils/TypeTraits.cpp
+++ b/clang-tools-extra/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) &&
OpenPOWER on IntegriCloud