Although it is not very common to define an empty enum, the following is a legitimate use case: [Extensible] enum SomeEnum {};
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/497ec8da95fdb294957278ebd8dc49d5f88b980f commit 497ec8da95fdb294957278ebd8dc49d5f88b980f Author: watk <watk@chromium.org> Date: Tue Mar 14 02:54:14 2017 mojo bindings: Support enums with no values Previously it was invalid to define an empty enum, i.e.: enum A {}; Now empty enums are a valid declaration. In practice it's not useful to have an empty, non-extensible enum because all values will fail message validation. However, an extensible empty enum may be useful because all values are valid for it. BUG= 619693 TEST=existing tests & new bindings conformance test Review-Url: https://codereview.chromium.org/2741943002 Cr-Commit-Position: refs/heads/master@{#456596} [add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.data [add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd21_empty_extensible_enum_accepts_any_value.expected [add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.data [add] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/data/validation/conformance_mthd22_empty_nonextensible_enum_accepts_no_values.expected [modify] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom [modify] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/tools/bindings/generators/cpp_templates/enum_macros.tmpl [modify] https://crrev.com/497ec8da95fdb294957278ebd8dc49d5f88b980f/mojo/public/tools/bindings/pylib/mojom/parse/parser.py
Comment 1 by cbiesin...@chromium.org
, Jul 11 2016