MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / dassert.d
blobc18a28d2ffb8c655c0a207298b67a917ad9ebb70
1 /*
2 REQUIRED_ARGS: -checkaction=context
3 TEST_OUTPUT:
4 ---
5 fail_compilation/dassert.d(14): Error: expression `AliasSeq!(0, 0)` of type `(int, int)` does not have a boolean value
6 fail_compilation/dassert.d(21): Error: assignment cannot be used as a condition, perhaps `==` was meant?
7 fail_compilation/dassert.d(29): Error: assignment cannot be used as a condition, perhaps `==` was meant?
8 fail_compilation/dassert.d(40): Error: expression `issue()` of type `void` does not have a boolean value
9 ---
11 #line 10
13 struct Baguette { int bread, floor; }
14 void main ()
16 assert(Baguette.init.tupleof);
19 // https://issues.dlang.org/show_bug.cgi?id=21590
20 void issue21590()
22 int a, b = 1;
23 assert (a = b);
25 static ref int get()
27 static int i;
28 return i;
31 assert(get() = 1);
33 // No errors for binary assignments (regardless of -checkaction=context)
34 int[] arr;
35 assert(arr ~= 1);
36 assert(a += b);
39 // https://issues.dlang.org/show_bug.cgi?id=21798
40 void issue()
42 assert(issue());