MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / depmsg.d
blobb0c2b2e6a8e87b92e01f8acaf7d417ab855ebbc2
1 // REQUIRED_ARGS: -de
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/depmsg.d(40): Deprecation: struct `depmsg.main.Inner.A` is deprecated - With message!
6 fail_compilation/depmsg.d(40): Deprecation: struct `depmsg.main.Inner.A` is deprecated - With message!
7 fail_compilation/depmsg.d(41): Deprecation: class `depmsg.main.Inner.B` is deprecated - With message!
8 fail_compilation/depmsg.d(41): Deprecation: class `depmsg.main.Inner.B` is deprecated - With message!
9 fail_compilation/depmsg.d(42): Deprecation: interface `depmsg.main.Inner.C` is deprecated - With message!
10 fail_compilation/depmsg.d(42): Deprecation: interface `depmsg.main.Inner.C` is deprecated - With message!
11 fail_compilation/depmsg.d(43): Deprecation: union `depmsg.main.Inner.D` is deprecated - With message!
12 fail_compilation/depmsg.d(43): Deprecation: union `depmsg.main.Inner.D` is deprecated - With message!
13 fail_compilation/depmsg.d(44): Deprecation: enum `depmsg.main.Inner.E` is deprecated - With message!
14 fail_compilation/depmsg.d(44): Deprecation: enum `depmsg.main.Inner.E` is deprecated - With message!
15 fail_compilation/depmsg.d(46): Deprecation: alias `depmsg.main.Inner.G` is deprecated - With message!
16 fail_compilation/depmsg.d(47): Deprecation: variable `depmsg.main.Inner.H` is deprecated - With message!
17 fail_compilation/depmsg.d(48): Deprecation: class `depmsg.main.Inner.I()` is deprecated - With message!
18 ---
21 void main()
23 class Inner
25 deprecated("With message!")
27 struct A { }
28 class B { }
29 interface C { }
30 union D { }
31 enum E { e };
32 //typedef int F;
33 alias int G;
34 static int H;
35 template I() { class I {} }
38 with(Inner)
40 A a;
41 B b;
42 C c;
43 D d;
44 E e;
45 //F f;
46 G g;
47 auto h = H;
48 I!() i;
53 TEST_OUTPUT:
54 ---
55 fail_compilation/depmsg.d(94): Deprecation: function `depmsg.test12954.Foo.bar1` is deprecated - [C] Use Foo.bar42 instead
56 fail_compilation/depmsg.d(95): Deprecation: function `depmsg.test12954.Foo.bar2` is deprecated - [E] Use Foo.bar42 instead
57 fail_compilation/depmsg.d(96): Deprecation: function `depmsg.test12954.Foo.bar3` is deprecated - [S] Use Foo.bar42 instead
58 fail_compilation/depmsg.d(97): Deprecation: function `depmsg.test12954.Foo.bar4` is deprecated - [F] Use Foo.bar42 instead
59 fail_compilation/depmsg.d(98): Deprecation: variable `depmsg.test12954.Foo.v2` is deprecated - Forward reference
60 fail_compilation/depmsg.d(105): Deprecation: class `depmsg.test12954.Obsolete` is deprecated
61 fail_compilation/depmsg.d(105): Deprecation: function `depmsg.test12954.Obsolete.obs` is deprecated - Function is obsolete
62 ---
64 void test12954()
66 struct Foo
68 enum DeprecatedReasonEnum = "[E] Use Foo.bar42 instead";
69 static const DeprecatedReasonStatic = "[S] Use Foo.bar42 instead";
70 static immutable DeprecatedReasonFunc = reason("Foo.bar42");
72 static string reason (string name)
74 return "[F] Use " ~ name ~ " instead";
77 deprecated("[C] Use " ~ `Foo.bar42 instead`)
78 void bar1 () {}
80 deprecated(DeprecatedReasonEnum)
81 void bar2 () {}
83 deprecated(DeprecatedReasonStatic)
84 void bar3 () {}
86 deprecated(DeprecatedReasonFunc)
87 void bar4 () {}
89 deprecated(Forward ~ Reference) int v2 = 2;
90 enum Forward = "Forward ", Reference = "reference";
93 Foo f;
94 f.bar1;
95 f.bar2;
96 f.bar3;
97 f.bar4;
98 assert(f.v2 == 2);
100 deprecated class Obsolete
102 deprecated("Function is obsolete") void obs() {}
105 (new Obsolete).obs();