Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -2888,6 +2888,8 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor

if (auto v = s.isVarDeclaration())
{
s.checkDeprecated(exp.loc, sc);

if (!v.type)
{
exp.error("forward reference of %s `%s`", v.kind(), v.toChars());
Expand Down
19 changes: 19 additions & 0 deletions test/fail_compilation/test19202.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
REQUIRED_ARGS: -de
TEST_OUTPUT
---
fail_compilation/test19202.d(13): Deprecation: variable `test19202.X!().X` is deprecated
---
*/

// https://issues.dlang.org/show_bug.cgi?id=19202

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

template X()
{
deprecated enum X = true;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this test for the sake of completeness:

deprecated enum X2() = true;