Fixed problem when instantiating a template with private global variables.

This commit is contained in:
Tomas Lindquist Olsen
2008-08-15 05:08:33 +02:00
parent 5aae7a6bee
commit 2b2291952c

View File

@@ -621,8 +621,11 @@ void VarDeclaration::toObjFile(int multiobj)
// global variable or magic
if (isDataseg())
{
Logger::println("data segment");
// we don't want to touch private static members at all !!!
if ((prot() == PROTprivate) && getModule() != gIR->dmodule)
// template instances should always be emitted
if (!DtoIsTemplateInstance(this) && prot() == PROTprivate && getModule() != gIR->dmodule)
return;
// don't duplicate work