Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/deprecations.d

raw
1 /*
2 REQUIRED_ARGS: -de
3 TEST_OUTPUT:
4 ---
5 fail_compilation/deprecations.d(43): Deprecation: struct `deprecations.S` is deprecated
6 fail_compilation/deprecations.d(64): instantiated from here: `otherPar!()`
7 fail_compilation/deprecations.d(55): Deprecation: struct `deprecations.S` is deprecated
8 fail_compilation/deprecations.d(65): instantiated from here: `otherVar!()`
9 fail_compilation/deprecations.d(55): Deprecation: struct `deprecations.S` is deprecated
10 fail_compilation/deprecations.d(65): instantiated from here: `otherVar!()`
11 ---
12
13 https://issues.dlang.org/show_bug.cgi?id=20474
14 */
15
16 deprecated struct S {}
17
18 deprecated void foo()(S par) if (is(S == S))
19 {
20 S var;
21 }
22
23 deprecated template bar() if (is(S == S))
24 {
25 void bar(S par)
26 {
27 S var;
28 }
29 }
30
31 deprecated void foobar (T) (T par) if (is(T == S))
32 {
33 T inst;
34 }
35
36 template otherPar()
37 {
38 deprecated void otherPar(S par)
39 {
40 S var;
41 }
42
43 void par(S par) {}
44 }
45
46 template otherVar()
47 {
48 deprecated void otherVar(S par)
49 {
50 S var;
51 }
52
53 void var()
54 {
55 S var;
56 }
57 }
58
59 deprecated void main()
60 {
61 foo(S.init);
62 bar(S.init);
63 foobar(S.init);
64 otherPar(S.init);
65 otherVar(S.init);
66 }