Bug 24365 – ICE when printing 'showCtfeContext' error

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-02-01T11:03:03Z
Last change time
2024-02-02T14:15:38Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2024-02-01T11:03:03Z
Found while adding a test case to core.demangle. ``` void main() { enum r = () { void f(); f(); return 2; }(); static assert(r == 2); } ``` The enum gets set to an `EXP.showCtfeContext` expression, which trips an assert when printed in the static assert failure: ``` Error: incompatible types for `(<error>) == (3)`: `void` and `int` error: EXP 121 has no string precedence not defined for token 'XXXXX' (...) src/dmd/hdrgen.d:3668 void dmd.hdrgen.expToBuffer(dmd.expression.Expression, dmd.parse.PREC, ref dmd.common.outbuffer.OutBuffer, ref dmd.hdrgen.HdrGenState) [0x6441f093586f] ```
Comment #1 by dlang-bot — 2024-02-01T15:38:09Z
@RazvanN7 updated dlang/dmd pull request #16131 "Fix Issue 24365 - ICE when printing showCtfeContext error" fixing this issue: - Fix Bugzilla 24365 - ICE when printing showCtfeContext error https://github.com/dlang/dmd/pull/16131
Comment #2 by dlang-bot — 2024-02-02T00:06:11Z
dlang/dmd pull request #16131 "Fix Issue 24365 - ICE when printing showCtfeContext error" was merged into stable: - 554efb7cca6f1ee9753bce9cd828f3b3cb267847 by RazvanN7: Fix Bugzilla 24365 - ICE when printing showCtfeContext error https://github.com/dlang/dmd/pull/16131
Comment #3 by dlang-bot — 2024-02-02T14:15:38Z
dlang/dmd pull request #16134 "merge stable" was merged into master: - c0101e095eb681434aae55270bfb200b8342ff84 by Razvan Nitu: Fix Bugzilla 24365 - ICE when printing showCtfeContext error (#16131) https://github.com/dlang/dmd/pull/16134