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

[clang-tidy] misc-static-assert false-positive #49876

Open
LebedevRI opened this issue May 30, 2021 · 1 comment
Open

[clang-tidy] misc-static-assert false-positive #49876

LebedevRI opened this issue May 30, 2021 · 1 comment
Labels
bugzilla Issues migrated from bugzilla clang:tooling LibTooling confirmed Verified by a second party

Comments

@LebedevRI
Copy link
Member

Bugzilla Link 50532
Version unspecified
OS Linux
Blocks #48661
CC @AaronBallman,@tstellar
Fixed by commit(s) be6b9e8

Extended Description

https://godbolt.org/z/9q3E1MqEq

@AaronBallman
Copy link
Collaborator

Reduced test case:

void foo() {
assert(false);
}

This is sort of not a false positive -- that assert can absolutely be converted into a static_assert. However, I don't think the suggestion is beneficial given how much code uses assert(false) to signify "this code path should not be taken at runtime", so I agree that the diagnostic shouldn't trigger in this case (at least, not without some opt-in option, but I'm not certain what the use case would be for such an option).

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@llvmbot llvmbot added the confirmed Verified by a second party label Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:tooling LibTooling confirmed Verified by a second party
Projects
None yet
Development

No branches or pull requests

3 participants