Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-Wreturn-type false-negative for fully-covered switch over enum that does not cover all possible underlying types #59085

Open
LebedevRI opened this issue Nov 19, 2022 · 0 comments
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer confirmed Verified by a second party

Comments

@LebedevRI
Copy link
Member

LebedevRI commented Nov 19, 2022

As per @apinski-cavium @ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107763,
clang's -Wreturn-type should fire on the following:

enum a { b };

int foo(a a) {
    switch(a) {
        case b: return 42;
    }
}

https://godbolt.org/z/j8ezrr5h3

@LebedevRI LebedevRI added the clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer label Nov 19, 2022
@AaronBallman AaronBallman added the confirmed Verified by a second party label Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer confirmed Verified by a second party
Projects
None yet
Development

No branches or pull requests

2 participants