MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / bug18743.d
blob9d2f888648123198986cecbd867ff81c30a25458
1 // REQUIRED_ARGS:
2 /*
3 TEST_OUTPUT:
4 ---
5 fail_compilation/bug18743.d(18): Error: `a ? a = 4 : a` must be surrounded by parentheses when next to operator `=`
6 fail_compilation/bug18743.d(19): Error: `a ? --a : a` must be surrounded by parentheses when next to operator `+=`
7 ---
8 */
10 void main()
12 int a;
14 // ok
15 (a ? a = 4 : a) = 5;
16 a ? a = 4 : (a = 5);
18 a ? a = 4 : a = 5;
19 a ? --a : a += 1;
21 a ? a = 4 : a++; // ok