[Issue 24071] New: When enum has typedef integer constants do not have types determined correctly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 5 09:37:52 UTC 2023


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

          Issue ID: 24071
           Summary: When enum has typedef integer constants do not have
                    types determined correctly
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: alphaglosined at gmail.com

>From wingdi.h:

```c
typedef enum
{
    DISPLAYCONFIG_OUTPUT_TECHNOLOGY_SVIDEO                  = 1,
    DISPLAYCONFIG_OUTPUT_TECHNOLOGY_INTERNAL                = 0x80000000,
} DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY;
```

Remove typedef and it works.


Some of the output:

```
C:\Program Files (x86)\Windows
Kits\10\include\10.0.20348.0\um\wingdi.h(2804,61): Error: integer constant
expression expected instead of `cast(uint)-1`
C:\Program Files (x86)\Windows
Kits\10\include\10.0.20348.0\um\wingdi.h(2805,61): Error: integer constant
expression expected instead of `cast(uint)0`
```

--


More information about the Digitalmars-d-bugs mailing list