This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove std::function in C++03
ClosedPublic

Authored by philnik on Jun 15 2022, 3:20 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rGc475e31a189c: [libc++] Remove std::function in C++03
Summary

std::function has been deprecated for a few releases now. Remove it with an option to opt-back-in with a note that this option will be removed in LLVM 16.

Diff Detail

Event Timeline

philnik created this revision.Jun 15 2022, 3:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 3:21 PM
philnik requested review of this revision.Jun 15 2022, 3:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 3:21 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
jloser added a subscriber: jloser.Jun 15 2022, 5:29 PM

I'm OK removing this extension with an opt-in knob depending on how bad the breakage is internally at Apple/Google.

To fix CI, we'll need to mark several tests with // UNSUPPORTED: c++03 now. While we're at it, let's please fix the typo in the commit title s/Remvoe/Remove; ditto for the commit message (s/with and/with an).

libcxx/docs/ReleaseNotes.rst
145

There are a few typos here. How about this, instead?

std::function has been removed in C++03. If you are using it, please remove usages or upgrade to C++11 or later. It is possible to re-enable std::function in C++03 mode by defining _LIBCPP_ENABLE_CXX03_FUNCTION. This option will be removed in LLVM 16.

philnik retitled this revision from [libc++] Remvoe std::function in C++03 to [libc++] Remove std::function in C++03.Jun 17 2022, 11:23 AM
philnik edited the summary of this revision. (Show Details)Jun 17 2022, 11:31 AM
ldionne added subscribers: EricWF, Restricted Project.Jun 17 2022, 2:13 PM

I'm OK removing this extension with an opt-in knob depending on how bad the breakage is internally at Apple/Google.

Just to make sure everyone's on the same page, we use these large code bases as guinea pigs to gauge how much breakage is likely out there -- it's not that we try to cater to these two code bases more specifically. If other vendors have the capability to run builds on large scale code bases, it would be great as well. Internal ref for me: 95412837.

Adding libc++ vendors for awareness. @EricWF Would you be able to try this out on a large code base internally? I suspect that most people are not using this extension, but who knows.

libcxx/docs/ReleaseNotes.rst
145

I like this reformulation. In particular, let's make sure to use LLVM 16, not libc++16 (which is not an official thing).

libcxx/include/__functional/function.h
1242
philnik updated this revision to Diff 438334.Jun 20 2022, 4:02 AM
philnik marked 2 inline comments as done.
  • Address comments
libcxx/docs/ReleaseNotes.rst
145

You say a few typos. Did I miss any, or was there just removed without the d?

philnik updated this revision to Diff 438397.Jun 20 2022, 7:48 AM
  • Enable std::function in the tests
jloser added inline comments.Jun 20 2022, 8:03 AM
libcxx/docs/ReleaseNotes.rst
145

I think there's one left. I'd reword "This option it" to "This option" (i.e. drop the word "it") to make this sentence read clearer IMO.

ldionne accepted this revision.Jun 20 2022, 6:01 PM

LGTM. I did not see any failure at all (which is quite unusual!), so I suspect this will not impact a lot of users.

This revision is now accepted and ready to land.Jun 20 2022, 6:01 PM

Please make sure you have green CI though.

philnik edited the summary of this revision. (Show Details)Jun 22 2022, 12:58 AM
This revision was automatically updated to reflect the committed changes.