Debian Codegraph @

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

raw
1 /* TEST_OUTPUT:
2 ---
3 fail_compilation/test18708.d(24): Error: one path skips field `s`
4 fail_compilation/test18708.d(29): Error: one path skips field `s`
5 fail_compilation/test18708.d(34): Error: one path skips field `s`
6 fail_compilation/test18708.d(39): Error: one path skips field `s`
7 ---
8 */
9 // https://issues.dlang.org/show_bug.cgi?id=18708
10
11 struct S { int y; @disable this(); }
12
13 class C
14 {
15 S s;
16
17 this(S t)
18 {
19 if (bar(s = t)) foo(); // OK
20 }
21
22 this(S t, int i)
23 {
24 i || bar(s = t);
25 }
26
27 this(S t, int i, int j)
28 {
29 i && bar(s = t);
30 }
31
32 this(S t, int i, long j)
33 {
34 i ? bar(s = t) : i;
35 }
36
37 this(S t, int i, byte j)
38 {
39 i ? i : bar(s = t);
40 }
41 }
42
43 int bar(S s);
44 int foo();
45
46 /***********************************/
47
48 class E : Exception
49 {
50 this(string msg, int line = 0, int pos = 0) pure nothrow @safe
51 {
52 if (line)
53 super("hello");
54 else
55 super(msg);
56 }
57
58 this(string msg, string file, size_t line) pure nothrow @safe
59 {
60 super(msg, file, line);
61 }
62 }