Summary: Regression(2.041): "str" ~ [arr] allows string literal
                    to be modified
           Product: D
           Version: D1 & D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD

--- Comment #0 from Don <> 2011-08-16 03:08:19 PDT ---
for (int i=0; i<3; ++i)
    char[] x2 = "xxx" ~ ['c'];
    assert(x2[1] == 'x');
    x2[1] = 'q';

The assertion fails the second time through the loop.
What happens, is that "xxx" ~ ['c'] becomes a string literal of value "xxxc"
and type char[]. Thus, it is modifiable.

This code passes on 2.040.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to