April 01, 2022 [Issue 22966] New: Inconsistent `shared`attribute for generated destructor | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22966 Issue ID: 22966 Summary: Inconsistent `shared`attribute for generated destructor Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: kinke@gmx.net The `shared` attribute for a generated destructor seems NOT to depend on the aggregate alone: ``` struct WithDtor { int x; ~this() {} } struct A { WithDtor withDtor; } struct B { version (Shared) shared A a; else A a; } struct C { A a; } void main() { B b; pragma(msg, A.__xdtor.mangleof); } ``` With DMD v2.099: ``` $ dmd -o- foo.d _D3mod1A11__fieldDtorMFZv $ dmd -o- foo.d -version=Shared _D3mod1A11__fieldDtorMOFZv ``` This leads to linker errors in real-world code. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply