Skip to content

Wrong layout for union with bitfields #1056

Closed
@pepyakin

Description

@pepyakin

See original issue #1034

Input C/C++ Header

Generated by C-Smith and reduced by creduce:

union U4 {
  unsigned : 1
};

Bindgen Invocation

$ bindgen input.h --with-derive-partialeq --with-derive-eq

Actual Results

running 1 test
test bindgen_test_layout_U4 ... FAILED

failures:

---- bindgen_test_layout_U4 stdout ----
	thread 'bindgen_test_layout_U4' panicked at 'assertion failed: `(left == right)`
  left: `2`,
 right: `1`: Size of: U4', /var/folders/cd/c9707gm91qj22fkb99clygfm0000gn/T/bindings.rs.XXXXXX.E24MhMan:58:4

failures:
    bindgen_test_layout_U4

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out

Expected Results

No layout test failures.

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