www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23825] New: No warnings printed for aliases to deprecated

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

          Issue ID: 23825
           Summary: No warnings printed for aliases to deprecated struct
                    or class members
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: elpenguino+D gmail.com

The following code should produce eight deprecation warnings:
```
class S {
        deprecated int a;
        deprecated static int b;
}
struct S2 {
        deprecated int a;
        deprecated static int b;
}
void main() {
        S s;
        alias a1 = S.a;
        alias a2 = s.a;
        alias b1 = S.b;
        alias b2 = s.b;
        S2 s2;
        alias c1 = S2.a;
        alias c2 = s2.a;
        alias d1 = S2.b;
        alias d2 = s2.b;
}
```
As of DMD 2.103, none are produced. Referencing the aliases does produce
warnings, however.

--
Apr 04 2023