www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20366] New: CTFE foreach_reverse on array with utf characters

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

          Issue ID: 20366
           Summary: CTFE foreach_reverse on array with utf characters
                    crashes compiler
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: sahmi.soulaimane gmail.com

Test case:

```
auto test()
{
    const(char)[] s = ['h', 'e', 'l', '\xef', '\xbd', '\x8c', 'o'];

    foreach_reverse (dchar c; s)
    {
    }

    return true;
}

static assert(test());
```

--
Nov 07 2019