[libcxx-commits] [libcxx] [libc++] Prevent cycle from including __mbstate_t.h within wchar.h (PR #200940)
Zibi Sarbinowski via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Aug 22 12:21:14 PDT 2026
zibi2 wrote:
The `std/modules/std.compat.pass.cpp` test is failing on macOS arm64 with:
```
cwchar:133: error: target of using declaration conflicts with declaration already in scope
using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
note: conflicting declaration
cuchar:62: using ::mbstate_t _LIBCPP_USING_IF_EXISTS;
```
Both `cwchar` and `cuchar` have always had `using ::mbstate_t _LIBCPP_USING_IF_EXISTS`. This was true before this branch as well. New `__fwd/mbstate_t.h` is structurally identical to the deleted `__std_mbstate_t.h` (same platform-specific sub-includes, same using declaration, same standalone module entry in module.modulemap.in). The error doesn't reference `__fwd/mbstate_t.h` at all.
@ldionne, could you confirm whether this `cwchar/cuchar` duplicate `using ::mbstate_t` conflict in the Darwin modules build is a pre-existing issue, or whether something in how I replaced `__std_mbstate_t.h` with `__fwd/mbstate_t.h` changes the module import ordering in a way that triggers it?
https://github.com/llvm/llvm-project/pull/200940
More information about the libcxx-commits
mailing list