Bug 12924 – deprecated("foo"); and deprecated; should not compile
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-15T06:23:00Z
Last change time
2014-06-18T08:25:03Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
issues.dlang
Comments
Comment #0 by issues.dlang — 2014-06-15T06:23:31Z
This code compiles with no errors or deprecation messages:
deprecated("Don't use me!");
void foo()
{
}
void main()
{
foo();
}
Of course, what it should be is
deprecated("Don't use me!")
void foo()
{
}
void main()
{
foo();
}
and that _will_ give a deprecation warning. However, I don't think that the problem is that the first example doesn't give a deprecation warning. Rather, it should be an error, as deprecated isn't a statement. It's an attribute.
Whether there is a message or not doesn't seem to affect anything, e.g.
deprecated;
void foo()
{
}
void main()
{
foo();
}
also compiles with no errors or deprecation warnings.