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:
Christian Kamm 2009-02-15 14:54:36 +01:00
parent 5471533dd0
commit f0dc6cb13e

View file

@ -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);
}
}