Skip to content

ImportC: Macros inside a typedef enum not seen #20410

@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

Atila Neves (@atilaneves) reported this on 2024-02-28T08:38:24Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24419

Description

------
// quux.c
typedef enum {
    #define R0 _RAX
    _RAX,
} reg;

// mod.d
import quux;
const _ = _RAX; // fine
const r0 = R0;  // oops
------

source/mod.d(3): Error: undefined identifier `R0`, did you mean variable `r0`?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions