blob: e93d40b224e60fedf5cf88fb201ab3f3a2a61c5e [file] [log] [blame]
/*
TEST_OUTPUT:
---
fail_compilation/diag14102.d(14): Error: `-x` is not an lvalue and cannot be modified
fail_compilation/diag14102.d(15): Error: `-(x -= 1)` is not an lvalue and cannot be modified
fail_compilation/diag14102.d(16): Error: `-(x -= 1 -= 1)` is not an lvalue and cannot be modified
fail_compilation/diag14102.d(17): Error: `-(x -= 1 -= 1 -= 1)` is not an lvalue and cannot be modified
---
*/
int main()
{
int x;
return -- -x; // error: -x is not an lvalue
return -- - --x; // error: -(x -= 1) is not an lvalue
return -- - -- --x; // error: -((x -= 1 , x) -= 1) is not an lvalue
return -- - -- -- --x; // error: -((ref int __assignop1 = x -= 1 , __assignop1 = x; , __assignop1 -= 1 , __assignop1) -= 1) is not an lvalue
}