This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Improve error messages for disabled modes
ClosedPublic

Authored by ldionne on May 18 2022, 10:20 AM.

Details

Reviewers
kubamracek
Group Reviewers
Restricted Project
Commits
rG1c4b31c38b3c: [libc++] Improve error messages for disabled modes
Summary

We should not surface CMake-level options like LIBCXX_ENABLE_FILESYSTEM
to our users, since they don't know what it means. Instead, use a slightly
more general wording.

Also, add an error in <ios> to improve the quality of errors for people
trying to use <iostream> when localization is disabled.

Diff Detail

Event Timeline

ldionne created this revision.May 18 2022, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2022, 10:20 AM
ldionne requested review of this revision.May 18 2022, 10:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2022, 10:20 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Nice user improvement!

libcxx/include/filesystem
264

In general I like the approach to make errors easier to understand. I just wonder would it be useful to keep the CMake flag? Something along the lines of the suggested edit.

libcxx/include/future
2435

<shared_mutex> and <thread> seem to have a similar issue.

kubamracek accepted this revision.May 18 2022, 4:45 PM

Very nice!

ldionne updated this revision to Diff 430694.May 19 2022, 8:27 AM
ldionne marked an inline comment as done.

Fix CI issues.

libcxx/include/filesystem
264

Frankly, I'm not sure. This is going to be seen by end-users exclusively, not by maintainers. They don't even know that we configure and build libc++ with CMake.

One could even argue that this can be confusing if a user is building *their* project with CMake -- it could be understood as saying that they should be passing LIBCXX_ENABLE_FILESYSTEM=ON to their own CMake configuration, which would be rather misleading.

libcxx/include/future
2435

Thanks for the catch!

ldionne accepted this revision as: Restricted Project.May 19 2022, 8:27 AM
This revision is now accepted and ready to land.May 19 2022, 8:27 AM
This revision was landed with ongoing or failed builds.May 20 2022, 6:37 AM
This revision was automatically updated to reflect the committed changes.
Mordante added inline comments.May 29 2022, 5:38 AM
libcxx/include/filesystem
264

Fair point. I don't feel very strongly about it. I expect (and hope) disabled headers are uncommon in practice.