Bug 21279 – cast expression between integer types is not defined

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-09-25T20:02:27Z
Last change time
2022-08-26T08:01:49Z
Keywords
pull, spec
Assigned to
No Owner
Creator
Steven Schveighoffer

Comments

Comment #0 by schveiguy — 2020-09-25T20:02:27Z
It was pointed out to me that there is nothing in the spect that defines casting between integer types of different sizes. For example: auto x = cast(int)long.max; There is nothing in the spec that says what should happen here. Of course, we all know what it should and does do. It should be spelled out. Also I cannot find "Value Range Propagation" anywhere in the spec. Somewhat related.
Comment #1 by dlang-bot — 2022-08-15T13:13:33Z
@ntrel created dlang/dlang.org pull request #3373 "Fix Issue 21279 - cast expression between integer types is not defined" fixing this issue: - Fix Issue 21279 - cast expression between integer types is not defined https://github.com/dlang/dlang.org/pull/3373
Comment #2 by nick — 2022-08-15T13:17:00Z
*** Issue 20708 has been marked as a duplicate of this issue. ***
Comment #3 by dlang-bot — 2022-08-26T08:01:49Z
dlang/dlang.org pull request #3373 "Fix Issue 21279 - cast expression between integer types is not defined" was merged into master: - b3b668f37ead8536d8ff81ff40caf34e3f05a4a5 by Nick Treleaven: Fix Issue 21279 - cast expression between integer types is not defined https://github.com/dlang/dlang.org/pull/3373