Use-after-scope bug in Phobos unittest, how to fix?

Johan j at j.nl
Tue May 16 18:08:07 UTC 2023


On Monday, 15 May 2023 at 20:22:15 UTC, Dennis wrote:
> On Monday, 15 May 2023 at 18:55:09 UTC, Johan wrote:
>> I see that the test is trying to prove that the MyRefCounted 
>> dtors are run correctly when the scope ends.
>
> That the destructor is run at the end of the scope is the job 
> of the compiler, not something that this unittest needs to 
> test. To test that the destructor nullifies the `store`, 
> `__dtor` can be called manually.

https://github.com/dlang/phobos/pull/8751


More information about the Digitalmars-d mailing list