From 2b2291952cc66d36f29f4648d9753cd3f538518f Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Fri, 15 Aug 2008 05:08:33 +0200 Subject: [PATCH] Fixed problem when instantiating a template with private global variables. --- gen/toobj.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gen/toobj.cpp b/gen/toobj.cpp index 67e42f86..1a237ddf 100644 --- a/gen/toobj.cpp +++ b/gen/toobj.cpp @@ -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