aboutsummaryrefslogtreecommitdiff
path: root/gcc/d/d-codegen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/d-codegen.cc')
-rw-r--r--gcc/d/d-codegen.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/d/d-codegen.cc b/gcc/d/d-codegen.cc
index 12c6f13..b4927a2 100644
--- a/gcc/d/d-codegen.cc
+++ b/gcc/d/d-codegen.cc
@@ -66,6 +66,7 @@ d_decl_context (Dsymbol *dsym)
{
Dsymbol *parent = dsym;
Declaration *decl = dsym->isDeclaration ();
+ AggregateDeclaration *ad = dsym->isAggregateDeclaration ();
while ((parent = parent->toParent2 ()))
{
@@ -74,7 +75,8 @@ d_decl_context (Dsymbol *dsym)
but only for extern(D) symbols. */
if (parent->isModule ())
{
- if (decl != NULL && decl->linkage != LINKd)
+ if ((decl != NULL && decl->linkage != LINKd)
+ || (ad != NULL && ad->classKind != ClassKind::d))
return NULL_TREE;
return build_import_decl (parent);