[libcxx-commits] [libcxx] r363692 - [libc++] Implement P0608R3 - A sane variant converting constructor

Eric Fiselier via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 20 13:39:25 PDT 2019


Hi Zhihao,

Thanks for your patience.
I have a handle on the build failures now, and thanks to your analysis, I'm
sure they're all intended (minus the SFINAE bug).

You're free to re-commit.

Ideally, a number of this breakages will be bugs that this paper intended
to prevent.
I'll report back once I've worked through all of them.

/Eric

On Wed, Jun 19, 2019 at 6:58 PM Zhihao Yuan <zy at miator.net> wrote:

> On Wednesday, June 19, 2019 1:19 PM, Eric Fiselier <eric at efcs.ca> wrote:
>
> [3] https://godbolt.org/z/YW_aSU (another example of broken user code)
>>
>>
>> This is not intended.  It is caused by a
>> bug in Clang.  I've made a patch to
>> workaround it in libc++
>>
>>   https://reviews.llvm.org/differential/diff/205513/
>>
>
> It turns out that the fix is a bad idea; it
> happens to work because of a bug,
> the behavior without the fix is required
> by the standard and is defendable.
>
> I thought the original behavior is a bug
> and filed a ticket,
>
>   https://bugs.llvm.org/show_bug.cgi?id=42330
>
> Richard explained that the seemly strange
> behavior -- adding/removing constexpr
> causes list-initialization to check differently
> in expression sfinae -- is legit.  So given the
> knowledge of "compiler needs to evaluate
> constexpr ctor for narrowing check, therefore
> instantiates template," I now think that this
> constructor in the original case
>
>   template <class U>
>   constexpr MyPtr(MyPtr<U>&& v) : ptr_(v.ptr_.release()) {}
>
> is just not sfinae-friendly.  Constraining it fixes
> the breakage:
>
>   https://godbolt.org/z/nfhkhG
>
> So I would suggest to test against the original
> commit instead:
>
>   https://reviews.llvm.org/rL363692
>
> :/
>
> --
> Zhihao Yuan, ID lichray
> The best way to predict the future is to invent it.
> _______________________________________________
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190620/07aa1d58/attachment.html>


More information about the libcxx-commits mailing list