# HG changeset patch # User lindquist # Date 1210044353 -7200 # Node ID 95f07e3f8bb97e59c765b40bff21a9d9353195c1 # Parent 6476da35a0fe688e194547b8641969557614be0e [svn r187] Fixed missing definitions of instances of imported struct template declarations. diff -r 6476da35a0fe -r 95f07e3f8bb9 gen/structs.cpp --- a/gen/structs.cpp Tue May 06 03:46:43 2008 +0200 +++ b/gen/structs.cpp Tue May 06 05:25:53 2008 +0200 @@ -176,6 +176,9 @@ Logger::println("DtoResolveStruct(%s): %s", sd->toChars(), sd->loc.toChars()); LOG_SCOPE; + if (sd->prot() == PROTprivate && sd->getModule() != gIR->dmodule) + Logger::println("using a private struct from outside its module"); + TypeStruct* ts = (TypeStruct*)DtoDType(sd->type); IrStruct* irstruct = new IrStruct(ts); @@ -337,7 +340,7 @@ gIR->irDsymbol[sd].irStruct->init = initvar; gIR->constInitList.push_back(sd); - if (sd->getModule() == gIR->dmodule) + if (DtoIsTemplateInstance(sd) || sd->getModule() == gIR->dmodule) gIR->defineList.push_back(sd); } diff -r 6476da35a0fe -r 95f07e3f8bb9 llvmdc.kdevelop.filelist --- a/llvmdc.kdevelop.filelist Tue May 06 03:46:43 2008 +0200 +++ b/llvmdc.kdevelop.filelist Tue May 06 05:25:53 2008 +0200 @@ -772,6 +772,7 @@ tangotests/stdout1.d tangotests/stdout2.d tangotests/t.d +tangotests/templ1.d tangotests/vararg1.d tangotests/vararg2.d test diff -r 6476da35a0fe -r 95f07e3f8bb9 tangotests/templ1.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tangotests/templ1.d Tue May 06 05:25:53 2008 +0200 @@ -0,0 +1,13 @@ +module tangotests.templ1; + +import Util = tango.text.Util; + +extern(C) int printf(char*, ...); + +void main() +{ + foreach (line; Util.lines("a\nb\nc")) + { + printf("%.*s\n", line.length, line.ptr); + } +}