1 // bindgen-flags: --opaque-type DoggoOrNull --with-derive-partialeq --with-derive-hash -- -std=c++14
2 
3 class Doggo {
4     int x;
5 };
6 
7 class Null {};
8 
9 /**
10  * This type is an opaque union. Unions can't derive anything interesting like
11  * Debug or Default, even if their layout can, because it would require knowing
12  * which variant is in use. Opaque unions still end up as a `union` in the Rust
13  * bindings, but they just have one variant. Even so, can't derive. We should
14  * probably emit an opaque struct for opaque unions... but until then, we have
15  * this test to make sure that opaque unions don't derive and still compile.
16  */
17 union DoggoOrNull {
18     Doggo doggo;
19     Null none;
20 };
21