[libcxx-commits] [PATCH] D113612: [libc++] Value-initialize unique_ptr's deleter_type

Johan Berg via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 19 09:55:26 PST 2021


bergjohan added a comment.

In D113612#3142773 <https://reviews.llvm.org/D113612#3142773>, @ldionne wrote:

> In D113612#3141239 <https://reviews.llvm.org/D113612#3141239>, @bergjohan wrote:
>
>> In D113612#3140624 <https://reviews.llvm.org/D113612#3140624>, @ldionne wrote:
>>
>>> Thanks for the patch! Is this implementing a specific LWG issue/paper, or did you just notice that we differed from the spec? I looked but couldn't find anything.
>>
>> Thanks for the review! I just noticed the diff from the spec.
>>
>> I can't believe I missed those two cases. I made the changes and added another test case.
>>
>> I also noticed there's a missing value initialization in the constructor taking an auto_ptr. But I was not able to run the auto_pointer.pass.cpp test because it was marked as unsupported.
>> Should we update that constructor as well, and if so, how do I run the test?
>
> It looks like the `auto_ptr` test requires C++11 or C++14. You can see how to run the test suite with different parameters here: https://libcxx.llvm.org/TestingLibcxx.html#usage
>
> Long story short, you can do:
>
>   <build-dir>/bin/llvm-lit -sv libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp --param std=c++14

Thanks, that did the trick!

I've added value-initialization to the auto_ptr constructor to match the spec, however, I'm not able to add a test for this specific case since this constructor is disabled for non-default deleters. The current tests for the auto_ptr constructor are still passing after the change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113612/new/

https://reviews.llvm.org/D113612



More information about the libcxx-commits mailing list