fix cxxmodule: export all CPOs unconditionally in fast_io module wrapper#1277
Conversation
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<T>) 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.
Minimal reproduction for fast_io C++20 module CPO export issue on clangIssueWhen using The Root CauseIn #if !defined(__clang__) // The gcc and msvc module does not support
// non-exported functions adl matching
using ::fast_io::io_stream_ref_define;
using ::fast_io::output_stream_ref_define;
using ::fast_io::write_some_overflow_define;
// ... many more CPOs ...
#endifThe comment assumes clang supports ADL matching non-exported names in However, on clang 23 for
FixRemove the // Before:
#if !defined(__clang__)
using ::fast_io::io_stream_ref_define;
// ...
#endif
// After (unconditional export):
using ::fast_io::io_stream_ref_define;
// ...Files to fix
Tested Environment
|
|
Based on https://eel.is/c++draft/basic.lookup.argdep:
|
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.