www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21123] New: ICE during toChars() of weird CommaExp lowering

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

          Issue ID: 21123
           Summary: ICE during toChars() of weird CommaExp lowering
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kinke gmx.net

The following code hits an assertion in the frontend (and makes it crash with
disabled assertions), presumably since v2.093 (as LDC v1.22 works), when
compiling with `-vcg-ast` (in order to call toChars()):

-----
struct Foo
{
    static Foo make() { return Foo(); }
    size_t length() { return 0; }
}

void main()
{
    auto x = Foo.make().make().length;
}
-----

The lowering for main is already weird with v2.092:

ulong x = (make() , make)().length();

--
Aug 05 2020