[Issue 14102] New: Bad 'is not an lvalue' diagnostic in chained -unary and --preincr expressions.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Feb 1 08:06:21 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14102

          Issue ID: 14102
           Summary: Bad 'is not an lvalue' diagnostic in chained -unary
                    and --preincr expressions.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: ibuclaw at gdcproject.org

int test(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
}

--


More information about the Digitalmars-d-bugs mailing list