[libcxx-commits] [PATCH] D92725: [libc++] [LWG2993] reference_wrapper<T> conversion from U&&

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Dec 5 16:47:28 PST 2020


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

Implement the resolution of LWG2993. Replace a deleted constructor with a constructor that SFINAEs away in appropriate circumstances.
Also, now that the constructor is templated, we must have an explicit deduction guide to make CTAD work.

Some tests have been merged in from D40259 <https://reviews.llvm.org/D40259>. I discovered the existence of D40259 <https://reviews.llvm.org/D40259> only after finishing the <__functional_base> patch itself, though; my impression is that my approach looks simpler than what @k-ballo did in that PR.

These two new tests fail before this patch, in C++11-through-C++20 modes:
std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp
std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor2.pass.cpp

The diffs in type_ctor.pass.cpp and copy_assign.pass.cpp are due to D40259 <https://reviews.llvm.org/D40259>, but have always been green (this patch doesn't affect their validity). I have no objection to removing those diffs, if requested, but I assumed they were in D40259 <https://reviews.llvm.org/D40259> for some reason.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92725

Files:
  libcxx/include/__functional_base
  libcxx/include/functional
  libcxx/test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
  libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/deduct.pass.cpp
  libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor.pass.cpp
  libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_conv_ctor2.pass.cpp
  libcxx/test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92725.309755.patch
Type: text/x-patch
Size: 9877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201206/c6f61b92/attachment.bin>


More information about the libcxx-commits mailing list