[libcxx-commits] [PATCH] D104310: [libc++] Remove more _LIBCPP_CXX03_LANG (iostreams edition)

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 15 10:04:10 PDT 2021


Quuxplusone created this revision.
Quuxplusone added reviewers: ldionne, EricWF, mclow.lists.
Quuxplusone added a project: libc++.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

This follows on from D104172 <https://reviews.llvm.org/D104172> (which is the same idea, STL container edition). The idea is to remove `#if`s 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!

To be landed as three commits, but I figure we can run one buildkite.

(1)

  [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.
  
  DON'T enable the move-enabled `operator<<` and `operator>>` templates;
  that will be done in a separate commit. Also DON'T enable basic_ios's
  `explicit operator bool`; Clang does support explicit conversion operators
  in C++03, but that machinery looks so scary I'm going to make it a
  separate commit as well.

(2)

  [libc++] Enable `basic_ios::operator bool` even in C++03.
  
  C++03 didn't support `explicit` conversion operators;
  but Clang's C++03 mode does, as an extension, so we can use it.

(3)

  [libc++] Enable the rvalue overloads of operator<< and operator>> even in C++03.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104310

Files:
  libcxx/include/fstream
  libcxx/include/ios
  libcxx/include/istream
  libcxx/include/ostream
  libcxx/include/sstream

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104310.352171.patch
Type: text/x-patch
Size: 13422 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210615/f37f2bd2/attachment-0001.bin>


More information about the libcxx-commits mailing list