Bug 21998 – checkaction=context should support basic types during CTFE

Status
NEW
Severity
normal
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-06T17:25:59Z
Last change time
2024-12-07T13:41:10Z
Assigned to
No Owner
Creator
moonlightsentinel
Moved to GitHub: dmd#17424 →

Comments

Comment #0 by moonlightsentinel — 2021-06-06T17:25:59Z
Formatting for basic types doesn't work during CTFE because the implementation calls into external functions which cannot be evaluated. For example, assert(1 == 2) aborts with `sprintf cannot be evaluated at compile time`.
Comment #1 by dlang-bot — 2021-06-06T17:43:39Z
@MoonlightSentinel created dlang/druntime pull request #3494 "Issue 21998 - Support formatting of integrals during CTFE with..." mentioning this issue: - Issue 21998 - Support formatting of integrals during CTFE with... ... checkaction=context. Use Druntime's internal implementation instead of LibC because it's ctfe'able. https://github.com/dlang/druntime/pull/3494
Comment #2 by dlang-bot — 2021-06-07T23:25:49Z
dlang/druntime pull request #3494 "Issue 21998 - Support more types during CTFE with checkaction=context" was merged into master: - f2d2d623451912b8f85caf5d5eda1cf8b7ac4621 by MoonlightSentinel: Issue 21998 - Support formatting of integrals during CTFE with... ... checkaction=context. Use Druntime's internal implementation instead of LibC because it's ctfe'able. - cfe0442debde0b993d2691609106e16eba62530c by MoonlightSentinel: Issue 21998 - Support formatting of pointers during CTFE with... ... checkaction=context. Use Druntime's internal implementation instead of LibC because it's ctfe'able. - 1de04fc8529b80e254a7b22507c039dfe628d901 by MoonlightSentinel: Issue 21998 - Support formatting of shared values during CTFE with... ... checkaction=context. Skip `atomicLoad` during CTFE, it's single threaded anyways. - 5d5f5683bc181b00c008f3ec68f093b3c43e4cf3 by MoonlightSentinel: Issue 21998 - Skip formatting of FPN's during CTFE with... ... -checkaction=context. An embedded warning about an unsupported type is better than the entire assertion failure being hidden by `Cannot evaluate *** at compile time`. - 2b5d52de8e820ec1cb6eb92619b124e741234444 by MoonlightSentinel: Issue 21998 - Support formatting of invalid enum values during CTFE ... with checkaction=context. Don't reinterpreting cast during CTFE. - b5c3ec8a285e3498f51934d46aad68dff13e1b06 by MoonlightSentinel: Issue 21998 - Skip formatting of void[] during CTFE with... ... -checkaction=context. An embedded warning about an unsupported type is better than the entire assertion failure being hidden by `Cannot cast ... at compile time`. https://github.com/dlang/druntime/pull/3494
Comment #3 by robert.schadek — 2024-12-07T13:41:10Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17424 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB