aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/dmd/statementsem.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/statementsem.c')
-rw-r--r--gcc/d/dmd/statementsem.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/d/dmd/statementsem.c b/gcc/d/dmd/statementsem.c
index ccf141e..0dc5e77 100644
--- a/gcc/d/dmd/statementsem.c
+++ b/gcc/d/dmd/statementsem.c
@@ -3492,12 +3492,18 @@ public:
}
s->semantic(sc);
- Module::addDeferredSemantic2(s); // Bugzilla 14666
- sc->insert(s);
-
- for (size_t j = 0; j < s->aliasdecls.dim; j++)
+ // https://issues.dlang.org/show_bug.cgi?id=19942
+ // If the module that's being imported doesn't exist, don't add it to the symbol table
+ // for the current scope.
+ if (s->mod != NULL)
{
- sc->insert(s->aliasdecls[j]);
+ Module::addDeferredSemantic2(s); // Bugzilla 14666
+ sc->insert(s);
+
+ for (size_t j = 0; j < s->aliasdecls.dim; j++)
+ {
+ sc->insert(s->aliasdecls[j]);
+ }
}
}
result = imps;