Skip to content

Commit

Permalink
fix Issue 9690 - cannot access to @disable'd symbol from inner functi…
Browse files Browse the repository at this point in the history
…on of another @disable'd
  • Loading branch information
9rnsr committed Nov 17, 2013
1 parent e560549 commit 57d52dd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/func.c
Expand Up @@ -165,6 +165,8 @@ void FuncDeclaration::semantic(Scope *sc)
if (StructDeclaration *sd = ad->isStructDeclaration())
sd->makeNested();
}
if (sc->func)
storage_class |= sc->func->storage_class & STCdisable;
// Remove prefix storage classes silently.
if ((storage_class & STC_TYPECTOR) && !(ad || isNested()))
storage_class &= ~STC_TYPECTOR;
Expand Down
15 changes: 15 additions & 0 deletions test/compilable/compile1.d
Expand Up @@ -398,6 +398,21 @@ void test9348()
assert(F!0 !in [new Object():1]);
}

/***************************************************/
// 9690

@disable
{
void dep9690() {}
void test9690()
{
dep9690(); // OK
void inner()
{
dep9690(); // OK <- NG
}
}
}

/***************************************************/
// 9987
Expand Down

0 comments on commit 57d52dd

Please sign in to comment.