Skip to content

Commit

Permalink
[clang-tidy] Move incomplete type test into separate test file
Browse files Browse the repository at this point in the history
Summary: Move in complete type test which does not compile into its own test file.

Reviewers: alexfh, sbenza, aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D26369

llvm-svn: 286155
  • Loading branch information
Felix Berger committed Nov 7, 2016
1 parent 9d8ab72 commit 4a3f94c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
@@ -0,0 +1,9 @@
// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -fix-errors -- --std=c++11

// 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]
}

@@ -1,4 +1,4 @@
// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t -- -fix-errors -- --std=c++11
// RUN: %check_clang_tidy %s performance-unnecessary-value-param %t

// CHECK-FIXES: #include <utility>

Expand Down Expand Up @@ -238,13 +238,6 @@ void PositiveConstRefNotMoveAssignable(ExpensiveToCopyType A) {
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]
}

// Case where parameter in declaration is already const-qualified but not in
// implementation. Make sure a second 'const' is not added to the declaration.
void PositiveConstDeclaration(const ExpensiveToCopyType A);
Expand Down

0 comments on commit 4a3f94c

Please sign in to comment.