D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21421 - core.stdcpp.new_.cpp_delete does not work with classes
Summary: core.stdcpp.new_.cpp_delete does not work with classes
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-11-24 10:40 UTC by Nathan S.
Modified: 2020-12-14 09:40 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nathan S. 2020-11-24 10:40:45 UTC
Code:
---
void cpp_delete(T)(T instance) if (is(T == class))
{
    destroy!false(instance);
    __cpp_delete(instance);
}
---

Problem: __cpp_delete requires "void*" argument and classes don't implicitly convert to void*.
Comment 1 Dlang Bot 2020-11-24 10:41:34 UTC
@n8sh updated dlang/druntime pull request #3284 "core.stdcpp.new_.cpp_delete unnecessarily requires destruction to be @nogc" fixing this issue:

- Fix Issue 21421 - core.stdcpp.new_.cpp_delete does not work with classes

https://github.com/dlang/druntime/pull/3284
Comment 2 Dlang Bot 2020-12-14 09:40:32 UTC
dlang/druntime pull request #3284 "core.stdcpp.new_.cpp_delete unnecessarily requires destruction to be @nogc" was merged into stable:

- a0acfb2f58fd688a7a4dcad5e51441e78fcba26f by Nathan Sashihara:
  Fix Issue 21421 - core.stdcpp.new_.cpp_delete does not work with classes

https://github.com/dlang/druntime/pull/3284