Created attachment 1918
Test program
The value long.min written as decimal results in an overflow error, both for ldc2 and dmd.
long z=-9223372036854775808L;
Error: signed integer overflow
Compiler used
dmd --version
DMD64 D Compiler v2.109.0-rc.1
Copyright (C) 1999-2024 by The D Language Foundation, All Rights Reserved written by Walter Bright
ldc2 --version
LDC - the LLVM D compiler (1.39.0):
based on DMD v2.109.1 and LLVM 18.1.6
built with LDC - the LLVM D compiler (1.39.0)
Comment #1 by dkorpel — 2024-10-01T12:15:34Z
That expression gets parsed as -(9223372036854775808L), and 9223372036854775808 does not fit in a long, but you require it to be a long with the L suffix. You can remove the L suffix, or replace it with UL, and then the program works.
Since this is filed as an enhancement request, what part of this behavior do you want to see changed exactly?
Comment #2 by robert.schadek — 2024-12-13T19:37:40Z