diff options
author | Eric Seppanen <eds@reric.net> | 2021-11-07 13:41:19 -0800 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2021-11-26 02:33:39 +0100 |
commit | 0a24ab3a304e7d8f0a08918413145667cabb9aaa (patch) | |
tree | 2c8e1cc91f51c4f87e8cb5ea621049e67e00357a /bindgen-integration/cpp/Test.h | |
parent | 2aed6b0216805e27228ed39988ffe1a1ffd7e940 (diff) |
allow custom derives on enums
Custom derives are just as useful on enums as they are on structs; not
supporting this was an oversight.
Adds a test that will fail to compile if the custom derive doesn't work
on enums. This test fails without the codegen fix.
Diffstat (limited to 'bindgen-integration/cpp/Test.h')
-rw-r--r-- | bindgen-integration/cpp/Test.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bindgen-integration/cpp/Test.h b/bindgen-integration/cpp/Test.h index ad71b0f6..eee1974c 100644 --- a/bindgen-integration/cpp/Test.h +++ b/bindgen-integration/cpp/Test.h @@ -234,3 +234,10 @@ typedef union { } Coord; Coord coord(double x, double y, double z, double t); + +// Used to test custom derives on enum. See `test_custom_derive`. +enum MyOrderedEnum { + MICRON, + METER, + LIGHTYEAR, +}; |