summaryrefslogtreecommitdiff
path: root/tests/headers/contains-vs-inherits-zero-sized.hpp
blob: d354b0a2e5c31548ca93fb8445d3ec55c70e9d6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
};