Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 023fac9

Browse files
authored
Merge pull request #2378 from Geod24/remove-workaround
Remove unnecessary workaround
2 parents 377f048 + 122753b commit 023fac9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/object.d

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,18 +576,15 @@ nothrow @safe @nogc unittest
576576
/// ditto
577577
void destroy(T)(T obj) if (is(T == class))
578578
{
579-
// go through void** to avoid `alias this` preferring alias
580-
// this should not be necessary when @@@BUG6777@@@ is fixed
581-
auto ptr = () @trusted { return *cast(void**) &obj; } ();
582579
static if (__traits(getLinkage, T) == "C++")
583580
{
584581
obj.__xdtor();
585582

586583
enum classSize = __traits(classInstanceSize, T);
587-
ptr[0 .. classSize] = typeid(T).initializer[];
584+
(cast(void*)obj)[0 .. classSize] = typeid(T).initializer[];
588585
}
589586
else
590-
rt_finalize(ptr);
587+
rt_finalize(cast(void*)obj);
591588
}
592589

593590
/// ditto

0 commit comments

Comments
 (0)