[Issue 24365] New: ICE when printing 'showCtfeContext' error
    d-bugmail at puremagic.com 
    d-bugmail at puremagic.com
       
    Thu Feb  1 11:03:03 UTC 2024
    
    
  
https://issues.dlang.org/show_bug.cgi?id=24365
          Issue ID: 24365
           Summary: ICE when printing 'showCtfeContext' error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P3
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl
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]
```
--
    
    
More information about the Digitalmars-d-bugs
mailing list