[cfe-dev] Fwd: [patch][libcxx] fix C++98 binders when binding a ref-typed argument

Tim Song via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 3 18:10:46 PST 2021


On Wed, Mar 3, 2021 at 7:20 PM Arthur O'Dwyer via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> On Wed, Mar 3, 2021 at 8:03 PM Jesse Zhang via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>>
> Looks reasonable to me. Your patch seems to be simply improving libc++'s adherence to to the actual C++11 specification of bind1st/bind2nd in
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3337.pdf
>
> - Notice that bind1st/bind2nd did not exist in C++98, so libc++'s support of them in C++98 mode is a pure extension.

[citation needed]

> - Notice that bind1st/bind2nd were "deprecated on arrival" in C++11, and are no longer standard C++ as of C++17.
> So you're asking to "fix" an extension, to C++98, which has never existed non-deprecated in the paper standard, which hasn't existed (even in deprecated form) for two whole standard revisions at this point.
> BUT... by the same tokens, the stakes of fixing this must be pretty low, and your patch seems obviously "correct" to me.

The specification, which will happily perform anything up to a
reinterpret_cast, seems obviously defective.


More information about the cfe-dev mailing list