Skip to content

Commit 8865376

Browse files
committed
[RFC][libc++] Use IWYU pragma's.
The tools IWYU/clangd can suggest to remove unused headers. This suggests to remove test_macros.h. Removing this header can break tests. For example tests use #ifndef TEST_HAS_NO_WIDE_CHARACTERS test<wchar_t>(); #endif Since typically developers have wide characters the header is not used. The removal of the header breaks configurations that have wide characters disabled.
1 parent 642259a commit 8865376

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libcxx/test/support/test_macros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
//
88
//===----------------------------------------------------------------------===//
99

10+
// This header contains several configuration defines.
11+
// Removing the header would #ifndef TEST_FOO to unconditionally pass when
12+
// it's optionally defined in this header.
13+
//
14+
// IWYU pragma: always_keep
15+
1016
#ifndef SUPPORT_TEST_MACROS_HPP
1117
#define SUPPORT_TEST_MACROS_HPP
1218

0 commit comments

Comments
 (0)