mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 08:01:11 +03:00
[svn r187] Fixed missing definitions of instances of imported struct template declarations.
This commit is contained in:
parent
0269b4de6e
commit
d3b57eaf60
3 changed files with 18 additions and 1 deletions
|
@ -176,6 +176,9 @@ void DtoResolveStruct(StructDeclaration* sd)
|
||||||
Logger::println("DtoResolveStruct(%s): %s", sd->toChars(), sd->loc.toChars());
|
Logger::println("DtoResolveStruct(%s): %s", sd->toChars(), sd->loc.toChars());
|
||||||
LOG_SCOPE;
|
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);
|
TypeStruct* ts = (TypeStruct*)DtoDType(sd->type);
|
||||||
|
|
||||||
IrStruct* irstruct = new IrStruct(ts);
|
IrStruct* irstruct = new IrStruct(ts);
|
||||||
|
@ -337,7 +340,7 @@ void DtoDeclareStruct(StructDeclaration* sd)
|
||||||
gIR->irDsymbol[sd].irStruct->init = initvar;
|
gIR->irDsymbol[sd].irStruct->init = initvar;
|
||||||
|
|
||||||
gIR->constInitList.push_back(sd);
|
gIR->constInitList.push_back(sd);
|
||||||
if (sd->getModule() == gIR->dmodule)
|
if (DtoIsTemplateInstance(sd) || sd->getModule() == gIR->dmodule)
|
||||||
gIR->defineList.push_back(sd);
|
gIR->defineList.push_back(sd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -772,6 +772,7 @@ tangotests/s.d
|
||||||
tangotests/stdout1.d
|
tangotests/stdout1.d
|
||||||
tangotests/stdout2.d
|
tangotests/stdout2.d
|
||||||
tangotests/t.d
|
tangotests/t.d
|
||||||
|
tangotests/templ1.d
|
||||||
tangotests/vararg1.d
|
tangotests/vararg1.d
|
||||||
tangotests/vararg2.d
|
tangotests/vararg2.d
|
||||||
test
|
test
|
||||||
|
|
13
tangotests/templ1.d
Normal file
13
tangotests/templ1.d
Normal file
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue