diff options
author | Felix Berger <flx@google.com> | 2016-11-04 20:29:22 +0000 |
---|---|---|
committer | Felix Berger <flx@google.com> | 2016-11-04 20:29:22 +0000 |
commit | 393803328252836581bc2a2fd0c01a577fa986b8 (patch) | |
tree | ec10c4d6439fafc8f7f1b8019c41ac1320af2a67 /clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp | |
parent | 0f901c7ec4a39f07fd6b942839b669506e3247fb (diff) | |
download | bcm5719-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/test/clang-tidy/performance-unnecessary-value-param.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
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 e33f44927ee..75c8e1027e7 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 @@ -1,4 +1,4 @@ -// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t +// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -fix-errors -- --std=c++11 // CHECK-FIXES: #include <utility> @@ -237,3 +237,10 @@ void PositiveConstRefNotMoveAssignable(ExpensiveToCopyType A) { ExpensiveToCopyType B; B = A; } + +// Ensure that incomplete types result in an error from the frontend and not a +// clang-tidy diagnostic about IncompleteType being expensive to copy. +struct IncompleteType; +void NegativeForIncompleteType(IncompleteType I) { + // CHECK-MESSAGES: [[@LINE-1]]:47: error: variable has incomplete type 'IncompleteType' [clang-diagnostic-error] +} |