[Issue 24264] New: ImportC: inliner trips on _Bool return

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 28 16:39:41 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=24264

          Issue ID: 24264
           Summary: ImportC: inliner trips on _Bool return
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dkorpel at live.nl

```C
typedef struct
{
    int small;
    int symbol;
} S;

inline int getSym(S self)
{
    return self.symbol;
}

_Bool symIs0(S self)
{
    return getSym(self) == 0;
}

void main(void)
{
    S s = {0, 0};
    __check(symIs0(s));
}
```

The assert fails, while it passes when removing `inline` or changing `_Bool` to
`int`.

--


More information about the Digitalmars-d-bugs mailing list