Skip to content

Commit

Permalink
Fix Issue 19202 - deprecated eponymous template prints no warning
Browse files Browse the repository at this point in the history
  • Loading branch information
RazvanN7 committed Dec 17, 2018
1 parent 55094b1 commit e2bda94
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 @@ -1975,6 +1975,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 e2bda94

Please sign in to comment.