Bug 14875 – A template instance with deprecated symbol/type needlessly repeats "Deprecation:" messages
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-08-06T09:47:00Z
Last change time
2017-07-22T12:36:23Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2015-08-06T09:47:32Z
Example code:
deprecated class Dep { }
alias X = Foo!Dep; // Line 3
template Foo(T)
{
pragma(msg, T); // Line 7
enum Foo = cast(void*)Bar!T;
}
template Bar(T)
{
pragma(msg, T); // Line 12
enum Bar = &Baz!T;
}
template Baz(T)
{
pragma(msg, T); // Line 18
immutable Baz = 1234;
}
Output:
test.d(3): Deprecation: class test.Dep is deprecated
test.d(7): Deprecation: class test.Dep is deprecated
Dep
test.d(12): Deprecation: class test.Dep is deprecated
Dep
test.d(18): Deprecation: class test.Dep is deprecated
Dep
Dep
Current compiler reports the message at the every use of deprecated symbols.
However, if a deprecated symbol/type comes from template parameter, the report for that is already done at the instantiation point.
The rest is just redundant.
So, I think output of the example code should be changed to:
test.d(3): Deprecation: class test.Dep is deprecated
Dep
Dep
Dep
Dep