Skip to content

Using libclang to parse C headers in C-mode containing Enum definitions does not return ENUM_CONSTANT_DECL nodes #159075

@DeinAlptraum

Description

@DeinAlptraum

When using libclang to parse a C headerfile containing several enum definitions, all Enums as well as all their respective variants are contained in the AST. However, parsing the file with -x c flag only finds a PARM_DECL and TYPE_REF node for each enum variant definition.
Changing the flag to -x c++ correctly detects a ENUM_CONSTANT_DECL node for each variant.

See also discussion here: #143264 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions