January 08, 2022
https://issues.dlang.org/show_bug.cgi?id=22659

          Issue ID: 22659
           Summary: [REG master] Error: declaration '(S[2] arr =
                    __error__;)' is not yet implemented in CTFE
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: ibuclaw@gdcproject.org

When there is a mismatch between compiler and run-time, or the body fails to compile for whatever reason, bad errors with the new templated lowerings ensue.

This was caused by recent gagging that is now done in the front-end.

https://github.com/dlang/dmd/pull/13476

---
module object;

alias size_t = typeof(int.sizeof);
extern(C) void* memcpy(return void* s1, scope const void* s2, size_t n) pure;

Tarr1 _d_arrayctor(Tarr1 : T1[], Tarr2 : T2[], T1, T2)(scope Tarr2 from)
@trusted
{
    Tarr1 to;
    memcpy(to.ptr, from.ptr, to.length * T1.sizeof);
    *cast(size_t *)&to = from.length;
    return to;
}

bool test9245()
{
    struct S
    {
        this(this) { }
    }

    S[2] arr;
    S[2] arr2 = arr;

    return true;
}
static assert(test9245());

--