From 1247d0ed8f8bab52438e459fec4d5ffc7f68ee29 Mon Sep 17 00:00:00 2001 From: Felix Berger Date: Mon, 7 Nov 2016 21:45:58 +0000 Subject: [clang-tidy] Move incomplete type test into separate test file 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 --- .../performance-unnecessary-value-param-incomplete-type.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp (limited to 'clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp') diff --git a/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp new file mode 100644 index 00000000000..cd8c4daccb0 --- /dev/null +++ b/clang-tools-extra/test/clang-tidy/performance-unnecessary-value-param-incomplete-type.cpp @@ -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] +} + -- cgit v1.2.3