https://issues.dlang.org/show_bug.cgi?id=22728
Issue ID: 22728
Summary: importC: error: enum has no members when compiling
typedef’d enum.
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Encountered this when trying to compile sqlite:
// repo.c
typedef enum task_role { // repo.c(2): Error: `enum task_role` has no members
TASK_RENICED = -1,
TASK_UNSPECIFIED = 0,
TASK_FOREGROUND_APPLICATION = 1,
TASK_BACKGROUND_APPLICATION = 2,
TASK_CONTROL_APPLICATION = 3,
TASK_GRAPHICS_SERVER = 4,
TASK_THROTTLE_APPLICATION = 5,
TASK_NONUI_APPLICATION = 6,
TASK_DEFAULT_APPLICATION = 7,
TASK_DARWINBG_APPLICATION = 8,
} task_role_t;
If it’s a regular enum declaration instead of a typedef there is no error.
--