[libcxx-commits] [libcxx] [libcxx] Fix indirect includes for nolocale (PR #229601)

Michael Jones via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 7 13:54:49 PDT 2026


https://github.com/michaelrj-google updated https://github.com/llvm/llvm-project/pull/229601

>From 478a77e45d4b2236b7ec92f1df38e4d48fd11656 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Tue, 6 Oct 2026 22:58:43 +0000
Subject: [PATCH 1/2] [libcxx] Fix indirect includes for nolocale

The indirect include tests for several headers were failing when turning
on filesystem for LLVM-libc. This turned out to be because the nolocale
header was leaking ctime and other headers when building outside of
library mode. This PR just moves all the includes under the library
guard.
---
 .../support/no_locale/characters.h            | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/libcxx/include/__locale_dir/support/no_locale/characters.h b/libcxx/include/__locale_dir/support/no_locale/characters.h
index ffe66979169146..56d1bfdf2ab0f3 100644
--- a/libcxx/include/__locale_dir/support/no_locale/characters.h
+++ b/libcxx/include/__locale_dir/support/no_locale/characters.h
@@ -10,22 +10,22 @@
 #define _LIBCPP___LOCALE_DIR_SUPPORT_NO_LOCALE_CHARACTERS_H
 
 #include <__config>
-#include <__cstddef/size_t.h>
-#include <cctype>
-#include <cstdlib>
-#include <cstring>
-#include <ctime>
-#if _LIBCPP_HAS_WIDE_CHARACTERS
-#  include <cwchar>
-#  include <cwctype>
-#endif
-
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #  pragma GCC system_header
 #endif
 
 #if defined(_LIBCPP_BUILDING_LIBRARY)
 
+#  include <__cstddef/size_t.h>
+#  include <cctype>
+#  include <cstdlib>
+#  include <cstring>
+#  include <ctime>
+#  if _LIBCPP_HAS_WIDE_CHARACTERS
+#    include <cwchar>
+#    include <cwctype>
+#  endif
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 namespace __locale {
 

>From 265f35e8fc947de039a02d57c8b7968b2c8df725 Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Wed, 7 Oct 2026 20:54:20 +0000
Subject: [PATCH 2/2] remove now-unnecessary XFAILs

---
 libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp  | 3 ---
 .../test/std/language.support/support.runtime/csignal.pass.cpp | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp b/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
index 2f18dea203cffb..ace2eea17225a0 100644
--- a/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
+++ b/libcxx/test/std/depr/depr.c.headers/signal_h.compile.pass.cpp
@@ -6,9 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Static assertion failure.
-// XFAIL: LLVM-LIBC-FIXME
-
 // test <signal.h>
 
 #include <signal.h>
diff --git a/libcxx/test/std/language.support/support.runtime/csignal.pass.cpp b/libcxx/test/std/language.support/support.runtime/csignal.pass.cpp
index 9273a5de7edf61..4548d3417ec430 100644
--- a/libcxx/test/std/language.support/support.runtime/csignal.pass.cpp
+++ b/libcxx/test/std/language.support/support.runtime/csignal.pass.cpp
@@ -6,9 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Static assertion failure.
-// XFAIL: LLVM-LIBC-FIXME
-
 // test <csignal>
 
 #include <csignal>



More information about the libcxx-commits mailing list