Skip to content

Bad bindings for typedef to incomplete struct after Clang 22 change #3275

@zmodem

Description

@zmodem

After Clang's llvm/llvm-project#147835 we're seeing bad bindings (https://crbug.com/440975178). Here's a reduced example.

Unlike #3264 this doesn't involve any nested classes. Instead, this seems related to the removal of ElaboratedType nodes.

Header:

typedef struct cbb_st CBB;
struct cbb_st {
  int x;
};

Bindings before the Clang change:

pub type CBB = cbb_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cbb_st {
    pub x: ::std::os::raw::c_int,
}
[...]

After the Clang change:

pub type CBB = cbb_st;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cbb_st {
    pub _address: u8,
}
[...]

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