Paolo Bonzini <[email protected]> writes:
> Raise an error if an enum has no members. Such enums cannot be populated
> with a valid value, and therefore they can only be used as optional
> members. But QAPI leaves out optional members from the serialization
> protocol, and therefore the existence of the enum is completely pointless.
>
> The same limitation is not extended to an enum whose members are all
> compiled out; these can still be useful as optional members. However they
> cannot implicitly block usage of parent structures because, by virtue
> of having only conditional members, they are "enums with conditional
> first item" and must therefore be optional.
>
> Signed-off-by: Paolo Bonzini <[email protected]>
This one definitely needs to update docs/devel/qapi-code-gen.rst,
because that one has
Nothing prevents an empty enumeration, although it is probably not
useful.