[libcxx-commits] [libcxx] [RFC][libc++] Use IWYU pragma's. (PR #102191)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 6 11:00:02 PDT 2024
https://github.com/mordante created https://github.com/llvm/llvm-project/pull/102191
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.
>From 8865376cba3c98e8bd2a02360f37ba46e2e9353c Mon Sep 17 00:00:00 2001
From: Mark de Wever <koraq at xs4all.nl>
Date: Tue, 6 Aug 2024 19:48:58 +0200
Subject: [PATCH] [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.
---
libcxx/test/support/test_macros.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index 15fc5b69b52076..9dab5750a5f917 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -7,6 +7,12 @@
//
//===----------------------------------------------------------------------===//
+// This header contains several configuration defines.
+// Removing the header would #ifndef TEST_FOO to unconditionally pass when
+// it's optionally defined in this header.
+//
+// IWYU pragma: always_keep
+
#ifndef SUPPORT_TEST_MACROS_HPP
#define SUPPORT_TEST_MACROS_HPP
More information about the libcxx-commits
mailing list