| Issue |
83135
|
| Summary |
"missing default label" when all enum values are covered
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
mkmkme
|
Hi, I have a code snippet containing `switch` statement that always raises a warning: https://gist.github.com/mkmkme/eeb37b9af0869e00e0a2a45ae3c5aa61
Here in the code `switch` statement covers all possible `enum` values, but when I compile it with
```
clang++-18 -std=c++23 -Wall -Wextra -Weverything llvm-test.cpp
```
I'm getting
```
llvm-test.cpp:21:3: warning: 'switch' missing 'default' label [-Wswitch-default]
21 | switch (type) {
| ^
1 warning generated.
```
If I add `default` label there, I'll be getting
```
llvm-test.cpp:55:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
55 | default: break;
| ^
1 warning generated.
```
I think the first one is false-positive.
My setup:
```
❯ clang-18 -v
Ubuntu clang version 18.1.0 (++20240221023121+bba39443eb91-1~exp1~20240221023233.52)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/11
Selected GCC installation: /usr/bin/../lib/gcc/aarch64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
```
(reproduced the same behaviour on x86_64)
Ubuntu 22.04. Clang installed via script from apt.llvm.org
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs