Missing errors
rdebath opened this issue · comments
rdebath commented
Minor one for now, this should generate a "duplicate case label" or similar error.
int
func(int n)
{
switch (n) {
case 2 + 2:
return 1;
case 4:
return 2;
}
return 0;
}
Rui Ueyama commented
Yup. Case labels are actually ranges because of GNU extension https://gcc.gnu.org/onlinedocs/gcc/Case-Ranges.html, we need to also warn on something like 3 ... 7 and 5 ... 10.
Rui Ueyama commented
Fixed in 1a4f625.