ldc icon indicating copy to clipboard operation
ldc copied to clipboard

assert(0) as ternary RHS => crash

Open maxhaton opened this issue 2 years ago • 2 comments

int front(int param)
{
    return param ? 1 : assert(0);
}

Also causes an assertion failure in dmd (https://issues.dlang.org/show_bug.cgi?id=22587). Is it even valid code?

maxhaton avatar Dec 17 '21 17:12 maxhaton

Is it even valid code?

Yes, see the DIP

MoonlightSentinel avatar Dec 17 '21 17:12 MoonlightSentinel

Is it even valid code?

Yes, see the DIP

Good good, was just asking to be idiot-checked.

maxhaton avatar Dec 17 '21 18:12 maxhaton