JonasToth added inline comments.
================
Comment at: clang-tidy/hicpp/MultiwayPathsCoveredCheck.cpp:119
+ if (!SwitchHasDefault && SwitchCaseCount == 0) {
+ diag(Switch->getLocStart(), "degenerated switch without labels");
+ return;
----------------
aaron.ballman wrote:
> I think a better way to phrase this one is: "switch statement without labels
> has no effect" and perhaps have a fix-it to replace the entire switch
> construct with its predicate?
The fixit would only aim for the sideeffects the predicate has, right? I would
consider such a switch as a bug or are there reasonable things to accomplish?
Given its most likely unintended code i dont think a fixit is good.
Fixing the code removes the warning and might introduce a bug.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D40737
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits