mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00

For the `TypeInfo_Struct.xdtor` field, the linkage of the aggregate itself plays no role; it's the linkage of the destructor that matters. A real-life example for this is DMD's own `OutBuffer`.
25 lines
325 B
D
25 lines
325 B
D
// https://issues.dlang.org/show_bug.cgi?id=24139
|
|
|
|
struct S1
|
|
{
|
|
int x;
|
|
extern(C++) ~this() { assert(&this == s1); }
|
|
}
|
|
|
|
extern(C++) struct S2
|
|
{
|
|
int x;
|
|
~this() { assert(&this == s2); }
|
|
}
|
|
|
|
S1* s1;
|
|
S2* s2;
|
|
|
|
void main()
|
|
{
|
|
s1 = new S1;
|
|
s2 = new S2;
|
|
|
|
typeid(S1).destroy(s1);
|
|
typeid(S2).destroy(s2);
|
|
}
|