Debian Codegraph @

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

raw
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail159.d(24): Error: static assert: `foo(S(1, 5), S(1, 4)) == 0` is false
5 ---
6 */
7
8 struct S
9 {
10 int i;
11 int j = 3;
12
13 int opEquals(S e2) { return 1; }
14 }
15
16 int foo(S s1, S s2)
17 {
18 return s1 == s2;
19 }
20
21 void main()
22 {
23 static assert(foo( S(1,5), S(1,5) ) == 1);
24 static assert(foo( S(1,5), S(1,4) ) == 0);
25 }