March 29, 2022 [Issue 22951] Dtor missing from generated C++ header | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22951 Dlang Bot <dlang-bot@dlang.rocks> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull --- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> --- @MoonlightSentinel created dlang/dmd pull request #13914 "Fix 22951 - Emit non-extern (C++) destructors as private members" fixing this issue: - Fix 22951 - Emit non-extern (C++) destructors as private members Destructors not marked as `extern (C++)` aren't accessible from C++ due to the D name mangling. The header generator used to skip `extern(D)` destructors, allowing C++ code that violated RAII guarantees. Declaring the constructors as `private` members ensures that any instance that would need to be destroyed on the C++ side causes a compiler error (rather than a linker error due to missmatched mangling). Renamed the helper function `checkVirtualFunction` because it now also handles other types of functions. https://github.com/dlang/dmd/pull/13914 -- | ||||
March 29, 2022 [Issue 22951] Dtor missing from generated C++ header | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22951 Dlang Bot <dlang-bot@dlang.rocks> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> --- dlang/dmd pull request #13914 "Fix 22951 - Emit non-extern (C++) destructors as private members" was merged into master: - 11be8a63105cb5e43b4a2c318260bafb8456af32 by MoonlightSentinel: Fix 22951 - Emit non-extern (C++) destructors as private members Destructors not marked as `extern (C++)` aren't accessible from C++ due to the D name mangling. The header generator used to skip `extern(D)` destructors, allowing C++ code that violated RAII guarantees. Declaring the constructors as `private` members ensures that any instance that would need to be destroyed on the C++ side causes a compiler error (rather than a linker error due to missmatched mangling). Renamed the helper function `checkVirtualFunction` because it now also handles other types of functions. https://github.com/dlang/dmd/pull/13914 -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply