From 559d444fc6a23f8be1af5fb8255e68b4aa3d99c7 Mon Sep 17 00:00:00 2001 From: Arendelle Date: Sun, 31 May 2026 23:48:18 +0800 Subject: [PATCH] fix cxxmodule: export all CPOs unconditionally in fast_io module wrapper fix(cxxmodule): export all CPOs unconditionally in fast_io module wrapper Several customization point objects (io_stream_ref_define, output_stream_ref_define, write_some_overflow_define, etc.) in cxxmodule/fast_io/fast_io_inc/core.inc were guarded by #if !defined(__clang__), under the assumption that clang supports finding non-exported names via ADL in module contexts. This assumption does not hold on clang 23 for x86_64-windows-gnu, where importing the fast_io module and calling println(u8c_stdout(), u8string) fails: static assertion failed due to requirement 'type_ok': some types are not printable for print on default C's stdout Without these exports, the requires clause on output_stream_ref (has_output_or_io_stream_ref_define) fails via SFINAE, causing print_freestanding_okay to fall through to the char-based hosted path, which cannot handle char8_t data. Remove the clang guard so CPOs are exported unconditionally. Also prefix all HTML AST node types with Html in pltxt2htm.cppm to match the upstream rename, and add missing table-node exports. --- share/fast_io/fast_io_inc/core.inc | 2 -- share/fast_io/fast_io_inc/hosted/win32.inc | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/share/fast_io/fast_io_inc/core.inc b/share/fast_io/fast_io_inc/core.inc index 1a883ff43..3b05b3877 100644 --- a/share/fast_io/fast_io_inc/core.inc +++ b/share/fast_io/fast_io_inc/core.inc @@ -52,7 +52,6 @@ using ::fast_io::open_mode; using ::fast_io::basic_io_lockable; using ::fast_io::basic_io_lockable_nonmovable; -#if !defined(__clang__) // The gcc and msvc module does not support non-exported functions adl matching using ::fast_io::input_stream_ref_define; using ::fast_io::output_stream_ref_define; using ::fast_io::io_stream_ref_define; @@ -123,7 +122,6 @@ using ::fast_io::io_stream_require_secure_clear_define; // using ::fast_io::input_stream_buffer_flush_define; using ::fast_io::output_stream_buffer_flush_define; using ::fast_io::io_stream_buffer_flush_define; -#endif namespace manipulators { diff --git a/share/fast_io/fast_io_inc/hosted/win32.inc b/share/fast_io/fast_io_inc/hosted/win32.inc index 4972cd0e2..9b46d0c3f 100644 --- a/share/fast_io/fast_io_inc/hosted/win32.inc +++ b/share/fast_io/fast_io_inc/hosted/win32.inc @@ -60,5 +60,5 @@ export namespace fast_io using ::fast_io::data_sync_flags; using ::fast_io::data_sync; -u using ::fast_io::flush; + using ::fast_io::flush; }