MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / diag14875.d
bloba4d4abe9e198d2979f08b975c6fe8abb65085c2e
1 // REQUIRED_ARGS: -o-
3 deprecated class Dep { }
4 deprecated immutable int depVar = 10;
6 /*
7 TEST_OUTPUT:
8 ---
9 fail_compilation/diag14875.d(16): Deprecation: class `diag14875.Dep` is deprecated
10 1: Dep
11 2: Dep
12 3: Dep
13 ---
16 alias X = Foo!Dep; // deprecation
18 template Foo(T)
20 pragma(msg, "1: ", T); // no message
21 enum Foo = cast(void*)Bar!T;
23 template Bar(T)
25 pragma(msg, "2: ", T); // no message
26 enum Bar = &Baz!T;
28 template Baz(T)
30 pragma(msg, "3: ", T); // no message
31 immutable Baz = 1234;
34 // ---
37 TEST_OUTPUT:
38 ---
39 fail_compilation/diag14875.d(52): Deprecation: class `diag14875.Dep` is deprecated
40 fail_compilation/diag14875.d(56): Deprecation: variable `diag14875.depVar` is deprecated
41 fail_compilation/diag14875.d(52): instantiated from here: `Voo!(Dep)`
42 4: Dep
43 fail_compilation/diag14875.d(63): Deprecation: variable `diag14875.depVar` is deprecated
44 fail_compilation/diag14875.d(59): instantiated from here: `Var!(Dep)`
45 fail_compilation/diag14875.d(52): instantiated from here: `Voo!(Dep)`
46 fail_compilation/diag14875.d(64): Deprecation: template `diag14875.Vaz(T)` is deprecated
47 fail_compilation/diag14875.d(59): instantiated from here: `Var!(Dep)`
48 fail_compilation/diag14875.d(52): instantiated from here: `Voo!(Dep)`
49 ---
52 alias Y = Voo!Dep; // deprecation
54 template Voo(T)
56 enum n = depVar; // deprecation
57 struct A { alias B = T; } // no message
58 pragma(msg, "4: ", A.B); // B is not deprecated
59 enum Voo = cast(void*)Var!T;
61 template Var(T)
63 enum n = depVar; // deprecation
64 enum Var = &Vaz!T; // deprecation
66 deprecated template Vaz(T)
68 enum n = depVar; // no message
69 immutable Vaz = 1234;
73 TEST_OUTPUT:
74 ---
75 fail_compilation/diag14875.d(80): Error: static assert: `0` is false
76 ---
78 void main()
80 static assert(0);