Re-introduce glue layer closure building error.

This reverts part of b15ffe2ef0,
and fixes 'fail_compilation/fail10666'.
This commit is contained in:
David Nadlinger 2014-06-04 14:34:28 +02:00
parent 829839be4a
commit b40969b660

View file

@ -449,6 +449,12 @@ void DtoCreateNestedContext(FuncDeclaration* fd) {
I != E; ++I) { I != E; ++I) {
VarDeclaration *vd = *I; VarDeclaration *vd = *I;
if (needsClosure && vd->needsAutoDtor()) {
// This should really be a front-end, not a glue layer error,
// but we need to fix this in DMD too.
vd->error("has scoped destruction, cannot build closure");
}
LLValue* gep = DtoGEPi(frame, 0, vd->ir.irLocal->nestedIndex, vd->toChars()); LLValue* gep = DtoGEPi(frame, 0, vd->ir.irLocal->nestedIndex, vd->toChars());
if (vd->isParameter()) { if (vd->isParameter()) {
Logger::println("nested param: %s", vd->toChars()); Logger::println("nested param: %s", vd->toChars());