diff options
Diffstat (limited to 'bindgen-tests/tests/headers/contains-vs-inherits-zero-sized.hpp')
-rw-r--r-- | bindgen-tests/tests/headers/contains-vs-inherits-zero-sized.hpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bindgen-tests/tests/headers/contains-vs-inherits-zero-sized.hpp b/bindgen-tests/tests/headers/contains-vs-inherits-zero-sized.hpp new file mode 100644 index 00000000..d354b0a2 --- /dev/null +++ b/bindgen-tests/tests/headers/contains-vs-inherits-zero-sized.hpp @@ -0,0 +1,21 @@ +/** + * This should get an `_address` byte. + */ +struct Empty {}; + +/** + * This should not get an `_address` byte, so `sizeof(Inherits)` should be + * `1`. + */ +struct Inherits : public Empty { + bool b; +}; + +/** + * This should not get an `_address` byte, but contains `Empty` which *does* get + * one, so `sizeof(Contains)` should be `1 + 1`. + */ +struct Contains { + Empty empty; + bool b; +}; |