| Issue |
83117
|
| Summary |
[Question] Which warning flags do I need for switch enum handling now?
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
FalcoGer
|
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?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs