Skip to content

Commit

Permalink
Merge pull request #3704 from 9rnsr/fix13008
Browse files Browse the repository at this point in the history
[REG2.066a] Issue 13008 - 'deprecated' is not allowed to refer another deprecated when it is a function declaration
  • Loading branch information
WalterBright committed Jul 1, 2014
2 parents 59f088f + 34f2f32 commit 6382ff6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/func.c
Expand Up @@ -442,7 +442,7 @@ void FuncDeclaration::semantic(Scope *sc)
if (!type->deco)
{
sc = sc->push();
sc->stc |= storage_class & STCdisable; // forward to function type
sc->stc |= storage_class & (STCdisable | STCdeprecated); // forward to function type
TypeFunction *tf = (TypeFunction *)type;
#if 1
/* If the parent is @safe, then this function defaults to safe
Expand Down
10 changes: 10 additions & 0 deletions test/compilable/test13008.d
@@ -0,0 +1,10 @@
// REQUIRED_ARGS: -o-
// PERMUTE_ARGS: -d -de -dw
/*
TEST_OUTPUT*
---
---
*/
deprecated class Dep { }
deprecated Dep depFunc1(); // error
deprecated void depFunc2(Dep); // error

0 comments on commit 6382ff6

Please sign in to comment.