diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2017-11-02 14:57:44 -0700 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2017-11-03 08:17:09 -0700 |
commit | 43b88c5e79fbff43449b2a8e584137ca00b13ae6 (patch) | |
tree | 77ca84509f75ddb53640b1e25fb6a40cdb0b0964 /tests/headers/templatized-bitfield.hpp | |
parent | 406b4775808a9dcd328491f4879c7cc5126307b3 (diff) |
Make bitfield unit allocation fallible
Instead of panicking when we see a bitfield that does not have a layout, return
an error up the stack. If we get an error when allocating bitfields into units,
then make the whole struct opaque.
Fixes #1140
Diffstat (limited to 'tests/headers/templatized-bitfield.hpp')
-rw-r--r-- | tests/headers/templatized-bitfield.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/headers/templatized-bitfield.hpp b/tests/headers/templatized-bitfield.hpp new file mode 100644 index 00000000..ed4a1540 --- /dev/null +++ b/tests/headers/templatized-bitfield.hpp @@ -0,0 +1,7 @@ +/// We don't get a layout for this bitfield, since we don't know what `T` will +/// be, so we cannot allocate bitfield units. The best thing we can do is make +/// the struct opaque. +template <class T> +class TemplatizedBitfield { + T t : 6; +}; |