[libcxx-commits] [PATCH] D104172: [libc++] Remove some obsolete _LIBCPP_CXX03_LANG

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 11 19:44:39 PDT 2021


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

Based on this comment <https://reviews.llvm.org/D103753#inline-987221> from D103753 <https://reviews.llvm.org/D103753>.

  We don't pretend to implement a "C++03 library"; no libc++ user should
  ever be relying on the fact that e.g. `emplace_back` does NOT exist.
  
  We support GCC only with `-std=c++11` and later.
  
  We support Clang in `-std=c++03` mode, but Clang supports rvalue references,
  defaulted member functions, NSDMIs, and variadic templates all as extensions
  to C++03.
  
  Conclusion: Several instances of _LIBCPP_CXX03_LANG are unnecessary.
  
  However, it's still true that in `-std=c++03` mode we're not allowed to use
  - `std::initializer_list`
  - braces around member-initializers
  - the `constexpr` or `noexcept` keywords
  
  And I don't think we want to turn on user-visible move constructors;
  e.g. today in `-std=c++03` mode,
  
      std::vector<T> v(1);
      auto w = std::move(v);
  
  visibly calls T's copy ctor.
  I think it would be reckless to change that, at least in this particular patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104172

Files:
  libcxx/include/__memory/shared_ptr.h
  libcxx/include/bitset
  libcxx/include/deque
  libcxx/include/forward_list
  libcxx/include/list
  libcxx/include/set
  libcxx/include/vector

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104172.351622.patch
Type: text/x-patch
Size: 20105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210612/56858f82/attachment-0001.bin>


More information about the libcxx-commits mailing list