Benjamin Bannier created MESOS-5235:
---------------------------------------
Summary: Add clang-tidy check catching default branch when
switching over enum values
Key: MESOS-5235
URL: https://issues.apache.org/jira/browse/MESOS-5235
Project: Mesos
Issue Type: Improvement
Reporter: Benjamin Bannier
{{Enum}} values have a limited domain which allows compilers to emit
diagnostics if not all possible values are handled in {{switch}} statements.
Adding {[default}} branches interferes with these compiler checks as a
{{default}} branch would always match.
We try to avoid {{default}} branches in {{switch}} statements over enum values,
and should add a static analysis check to catch any such instances.
This should be an easier starter check to implement since it should be possible
to implement all the matching with {{clang-tidy}} matchers.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)