When ``_d_newclassT`` was templified, the COM support was regressed. Previously it would allocate using malloc, now it allocates using the GC. https://github.com/dlang/dmd/blob/f1adbd18a2fe262ee7474193383ea579f09e794e/druntime/src/core/lifetime.d#L2742 The reason for this regression is the gate for determining if a class is a COM class. Previously it used the TypeInfo flag. https://github.com/dlang/dmd/blob/1317ba12e242c1fffa76d1cb5e1a405745f89021/druntime/src/rt/lifetime.d#L92 COM classes have the linkage D, but are actually C++ classes in ABI. Due to this they cannot be checked by the linkage, and changing this would either result in a lie, or not be a useful distinction here. My suggestion is to add a new trait ``isCOMClass``, it needs to read the field ``com`` and return that from the class declaration.
@rikkimax created dlang/dmd pull request #17095 "Fix bugzilla issue 24882 - COM class is allocated using GC not malloc" fixing this issue: - Fix bugzilla issue 24882 - COM class is allocated using GC not malloc https://github.com/dlang/dmd/pull/17095
dlang/dmd pull request #17095 "Fix bugzilla issue 24882 - COM class is allocated using GC not malloc" was merged into stable: - cc21a03174dc2fb627442ca201a1f0ed9d18a9bc by Richard (Rikki) Andrew Cattermole: Fix bugzilla issue 24882 - COM class is allocated using GC not malloc https://github.com/dlang/dmd/pull/17095
dlang/dmd pull request #17098 "Merge stable" was merged into master: - 6567f6f4a4a6ad95da1a340e12b1f1130a5a10c0 by Richard (Rikki) Andrew Cattermole: Fix bugzilla issue 24882 - COM class is allocated using GC not malloc https://github.com/dlang/dmd/pull/17098