Page MenuHomePhabricator

[libc++] Remove more _LIBCPP_CXX03_LANG (iostreams edition)
ClosedPublic

Authored by Quuxplusone on Jun 15 2021, 10:04 AM.

Details

Summary

This follows on from D104172 (which is the same idea, STL container edition). The idea is to remove #ifs that have become unnecessary due to Clang's C++03 mode gaining more C++11 features as extensions. We need to keep libc++ building with clang++ -std=c++03 and with g++ -std=c++11, but we don't claim to build in pedantic C++03 mode — anything Clang supports with a warning, we can use!

[libc++] Remove some _LIBCPP_CXX03_LANG from iostreams headers.

With the STL containers, I didn't enable move operations in C++03 mode
because that would change the overload resolution for things that today
are copy operations. With iostreams, though, the copy operations aren't
present at all, and so I see no problem with enabling move operations
even in (Clang's greatly extended) C++03 mode.

Clang's C++03 mode does not support delegating constructors.

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Jun 15 2021, 10:04 AM
Quuxplusone created this revision.
Herald added a reviewer: Restricted Project. · View Herald TranscriptJun 15 2021, 10:04 AM

Rebase. Hoping to land on Monday alongside D104172, if someone can give me a thumbs-up here.

Quuxplusone planned changes to this revision.Jun 21 2021, 7:25 PM
Quuxplusone edited the summary of this revision. (Show Details)

Update affected unit tests, and rebase.
This is now just one commit, not three, because the other two commits (with their affected unit tests) have been split out into D104682 and D104725.

Rebase on master.
Enable the rvalue overloads of std::getline in C++03 mode, and update its tests.
Serendipitously, I was reminded of the rvalue overload of std::getline by https://github.com/microsoft/STL/pull/2025/files . I have no idea why this overload exists; if anyone thinks they know, I'd like to hear about it.

@ldionne ping! (I think D104310 is now more baked and less controversial than the STL-containers one in D104172.)

ldionne accepted this revision.Mon, Jun 28, 9:13 AM
This revision is now accepted and ready to land.Mon, Jun 28, 9:13 AM