<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/83117>83117</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Question] Which warning flags do I need for switch enum handling now?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
FalcoGer
</td>
</tr>
</table>
<pre>
I want the following behavior:
- Error when `switch(enumVal)` and not all cases are covered and also there is no `default`, ie. I want to be able to use default with enums to explicitly allow them without having to fallthrough all the values I don't want special cases for, but have a hard stop when I edit an enum and don't handle all the switch cases without a default because that's most likely a bug.
- Warning when `switch(enumVal)` and all cases are covered and there is a `default`, ie. all cases are covered and default is probably wrong because later editing the enum will make this a non-warning and probably produce a bug
- Warning when `switch(notEnumValPerhapsAnIntOrSomething)` and there is no `default`, because I probably want to do at lest something, or explicitly nothing to show that I didn't forget anything.
How do I achieve this now?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMlEGT4yYQhX8NvnSNS8KSbB902OysE5-SVKqy50a0BVlMuwBZmX-fAlmzPmSSvdiqAvr19_oBxmhHT9SL9ifRvm5wSoZDf0I38M8UNor1W3-GGX2CZAgu7BzP1o-gyODdchC7T6J6FdXj9wW-hMABZkMeRFfF2abBCHkgP13_RCfkUXQVoNfgOQE6BwNGioCBYOA7BdJlFV3kLBkIbATPuZimC04uia4S8jNY2sLaGoMiQOUof06R4LEVZpsMZO2YV-jvm7ODTe4tK_OcBa5lD08JMpAf874LOpdM4Gk0pcWMfkc3UYQzaPZC7tOiHG80WFwhLhxyZ2opRoBgMGiIiW-LI2cgbROgLz0V0LWcQa8dvcstxj3qrh3iO5eiATNnMpiE3Ee4ckzg7DfKbKCmcbsO5CsGn7l-YCQfj-N9Evjvg_j45NqxjXALrFC5N5gDlwgtDA4ThWJMsd_QYs5snYMrfsuQRdizf5kfMLnye7lbYD0NtHD_L7bn9GUh_42CwVv85M8-_Rr-4CslY_34ZMh_BnDt__wE9kijZsAEjmKC-L3sZ-DwnEHPZSEfiKakEVMOmNVLJC4cRsppeSv7ts8X7Rees8oZcDCW7g-TPM9id9rofqePuyNuqK_31bGSh6Y-bEy_08OlUd2ua2U7tN2xqztdtbLBrq2HZocb28tKNpWU-7qquvawxaOqL4pk09RUHZQUTUVXtG7r3P265TBubIwT9YddXe83DhW5WB4TKT3NUBaFlPltCX0-86KmMYqmcjam-L1KssmVV-j3iWKy7EX7Cl-NHQysI784HOPC7Il0dme9JSUv5QLljQ8TpuB6k9It5idKnoQ8jTaZSW0Hvgp5ytKPv5db4L9oSEKeSsNRyFMB-icAAP__Ri277w">