The code example

long add_long_n0(alias T=void)(long x) @safe pure nothrow @nogc { return x + 0; }

int main(string[] args)
{
    long long_sum = 0;
    long_sum += add_long_n0!(void)(cast(long)0);
    return cast(int)long_sum;
}


compiles without errors with dmd and ldc. But with gdc-10 as

    gdc -c linear_t.d

it errors as

linear_t.d:6:17: error: template instance add_long_n0!() does not match template declaration add_long_n0(alias T = void)(long x)
    6 |     long_sum += add_long_n0!()(cast(long)0);
      |                 ^


Why can't LDC handle such a trivial template example?

Reply via email to