Skip to content

libclang clang_getFieldDeclBitWidth assumes the bit width expression is evaluable  #56644

@chbaker0

Description

@chbaker0

clang_getFieldDeclBitWidth checks if the provided cursor is a bitfield declaration then proceeds to call FieldDecl::getBitWidthValue which in turn calls Expr::EvaluateKnownConstInt on the bit width expression.

EvaluateKnownConstInt requires the expression not be dependent on any template parameters. However, clang_getFieldDeclBitWidth doesn't account for this, and libclang does not expose an obvious way to check if an expression's value depends on a template parameter.

rust-lang/rust-bindgen#2239 is related

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions