Skip to content

_Float16 _Complex leads to panic (such as when including immintrin.h on clang 16) #2500

@xzn

Description

@xzn

Input C/C++ Header

/* input.h */
_Float16 _Complex h;

Bindgen Invocation

$ bindgen input.h

Actual Results

panicked at 'Non floating-type complex? Type(_Complex _Float16, kind: Complex, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Type(_Float16, kind: Float16, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None))', J:\Compilers\Rust\.cargo\registry\src\github.com-1ecc6299db9ec823\bindgen-0.65.1\ir\context.rs:1994:26

Expected Results

Command completes without error.

Synopsis

Ran into this when using a header from a project that includes immintrin.h, which on clang 16 always seems to include avx512fp16intrin.h and avx512vlfp16intrin.h, which in turn have construct _Float16 _Complex, which currently bindgen cannot handle.

For example, running bindgen on SDL2's SDL.h which includes immintrin.h through SDL_cpuinfo.h results in the above error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions