zmodem wrote:

I wonder if we should also do something special about the 
`-Wdeprecated-declarations` diagnostic in switches.

If the user fixes the -Wswitch  / -Wreturn-type warnings from `testSwitchFour` 
the natural way:

```
int testSwitchFour(enum SwitchFour e) {
  switch (e) {
  case Red:   return 1;
  case Green: return 2;
  case Blue:  return 3;
  }
} 
```

They will get `warning: 'Blue' is deprecated [-Wdeprecated-declarations]` 
instead.

Maybe we should suppress that warning for switch cases? Or suggest adding a 
`default` label instead?

https://github.com/llvm/llvm-project/pull/138562
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to