mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Static ctors/dtors added via template mixins should not be added to modules
that just import a module containing such a mixin.
This commit is contained in:
@@ -536,13 +536,13 @@ void DtoDeclareFunction(FuncDeclaration* fdecl)
|
||||
|
||||
// static ctor
|
||||
if (fdecl->isStaticCtorDeclaration()) {
|
||||
if (fdecl->getModule() == gIR->dmodule || fdecl->inTemplateInstance()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->ctors.push_back(fdecl);
|
||||
}
|
||||
}
|
||||
// static dtor
|
||||
else if (fdecl->isStaticDtorDeclaration()) {
|
||||
if (fdecl->getModule() == gIR->dmodule || fdecl->inTemplateInstance()) {
|
||||
if (mustDefineSymbol(fdecl)) {
|
||||
gIR->dtors.push_back(fdecl);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user