When __locale_dir/locale_base_api/locale_guard.h is compiled independently, as it is when it's in its own clang module, it fails to compile due to locale_t being undefined. It needs to include __locale to get that, instead of just clocale.
Details
Details
- Reviewers
ldionne Mordante - Group Reviewers
Restricted Project - Commits
- rG6021c78fe55e: [libc++][Modules] locale fails to compile with clang modules when…
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
It looks like we don't have unit tests/CI for undef(_LIBCPP_HAS_NO_LOCALIZATION) + undef(_LIBCPP_LOCALE__L_EXTENSIONS). If anyone knows how to set that up please let me know!
libcxx/include/__locale_dir/locale_base_api/locale_guard.h | ||
---|---|---|
12–14 | We still need <clocale> because we are using setlocale(...) and friends. But we should indeed add <__locale> because that is what defines locale_t when libcxx/include/__support/xlocale/__nop_locale_mgmt.h is used. |
Comment Actions
Put the clocale include back
libcxx/include/__locale_dir/locale_base_api/locale_guard.h | ||
---|---|---|
12–14 | 👍 put <clocale> back |
libcxx/include/__locale_dir/locale_base_api/locale_guard.h | ||
---|---|---|
12–14 | and added the comment |
We still need <clocale> because we are using setlocale(...) and friends. But we should indeed add <__locale> because that is what defines locale_t when libcxx/include/__support/xlocale/__nop_locale_mgmt.h is used.