This is an archive of the discontinued LLVM Phabricator instance.

[libc++][format] Adds availability macros for std::format.
ClosedPublic

Authored by Mordante on May 18 2021, 11:12 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG963495f0d4b5: [libc++][format] Adds availability macros for std::format.
Summary

This prevents std::format to be available until there's an ABI stable
version. (This only impacts the Apple platform.)

Depends on D102703

Diff Detail

Event Timeline

Mordante requested review of this revision.May 18 2021, 11:12 AM
Mordante created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2021, 11:12 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.May 20 2021, 8:06 AM
ldionne added inline comments.
libcxx/include/__availability
145

Are there any feature test macros associated to this feature? If so, we'll need to disable the feature test macros when we disable the format feature (otherwise, the feature test macro will pretend that std::format is available, but one will get an availability error due to the attribute when trying to use it).

This revision now requires changes to proceed.May 20 2021, 8:06 AM
Mordante marked an inline comment as done.May 20 2021, 9:18 AM
Mordante added inline comments.
libcxx/include/__availability
145

Yes it's depends on __cpp_lib_format, which is currently marked as not implemented. I'll update the patch.

Mordante updated this revision to Diff 346766.May 20 2021, 9:37 AM
Mordante marked an inline comment as done.

Properly disable std::format when the availablity macro requires it.

ldionne accepted this revision.May 25 2021, 1:05 PM

Thanks!

This revision is now accepted and ready to land.May 25 2021, 1:05 PM
Mordante retitled this revision from Adds availability macros for std::format. to [libc++][format] Adds availability macros for std::format..May 26 2021, 8:54 AM