Skip to content

Commit

Permalink
Merge pull request #9079 from RazvanN7/Issue_19202
Browse files Browse the repository at this point in the history
Fix Issue 19202 - deprecated eponymous template prints no warning
merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
  • Loading branch information
dlang-bot authored Dec 17, 2018
2 parents 67dc1b9 + e2bda94 commit 07aff0b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -3113,6 +3113,7 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
exp.error("recursive expansion of %s `%s`", ti.kind(), ti.toPrettyChars());
return setError();
}
v.checkDeprecated(exp.loc, sc);
auto e = v.expandInitializer(exp.loc);
ti.inuse++;
e = e.expressionSemantic(sc);
Expand Down
17 changes: 17 additions & 0 deletions test/fail_compilation/fail19202.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// REQUIRED_ARGS: -de
/*
TEST_OUTPUT:
---
fail_compilation/fail19202.d(11): Deprecation: variable `fail19202.X!().X` is deprecated
---
*/

void main()
{
auto b = X!();
}

template X()
{
deprecated enum X = true;
}

0 comments on commit 07aff0b

Please sign in to comment.