www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16115] New: [REG2.067] Wrong code with comma operator

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

          Issue ID: 16115
           Summary: [REG2.067] Wrong code with comma operator
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: wrong-code
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

///////////////// test.d ////////////////
int n;

auto call()
{
//  n = Test.tag;              // Works
    return n = Test.tag, null; // Crash
}

struct Test
{
    enum tag = 42;
}

void main()
{
    call();

    assert(n == 42);
}
/////////////////////////////////////////

Introduced in https://github.com/dlang/dmd/pull/3979

--
Jun 02 2016