This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Implement locale.h to fix modules build
ClosedPublic

Authored by EricWF on Nov 17 2016, 6:20 PM.

Details

Summary

Because locale.h isn't part of the libc++ modules the class definitions it provides are exported as part of __locale (since it happens to be build first). This breaks <clocale> which exports std::lconv without including <__locale>.

This patch implements locale.h to fix this issue, it also adds support for testing libc++ with modules.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 78448.Nov 17 2016, 6:20 PM
EricWF retitled this revision from to [libcxx] Implement locale.h to fix modules build.
EricWF updated this object.
EricWF added reviewers: mclow.lists, rsmith.
EricWF added a subscriber: cfe-commits.
EricWF accepted this revision.Nov 18 2016, 5:02 PM
EricWF added a reviewer: EricWF.
This revision is now accepted and ready to land.Nov 18 2016, 5:02 PM
EricWF closed this revision.Nov 18 2016, 5:24 PM
rsmith edited edge metadata.Nov 18 2016, 6:03 PM

This should only be needed if you are not using -fmodules-local-submodule-visibility and do not have a module map for your C standard library. Is that really a configuration we want to support? Building without -fmodules-local-submodule-visibility typically only works if you modularize bottom-up, due to issues exactly like this one.

include/locale.h
2

This is not math.h.

EricWF added inline comments.Nov 18 2016, 6:18 PM
include/locale.h
2

It was fixed before committing but I didn't update phab.