-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[clangd] Disable crashy unchecked-optional-access tidy check #69427
Conversation
@llvm/pr-subscribers-clangd Author: kadir çetinkaya (kadircet) ChangesFixes #69369. Full diff: https://github.com/llvm/llvm-project/pull/69427.diff 1 Files Affected:
diff --git a/clang-tools-extra/clangd/TidyProvider.cpp b/clang-tools-extra/clangd/TidyProvider.cpp
index f101199a20cebf9..2a6fba52e29bf43 100644
--- a/clang-tools-extra/clangd/TidyProvider.cpp
+++ b/clang-tools-extra/clangd/TidyProvider.cpp
@@ -219,6 +219,9 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) {
"-bugprone-use-after-move",
// Alias for bugprone-use-after-move.
"-hicpp-invalid-access-moved",
+ // Check uses dataflow analysis, which might hang/crash unexpectedly on
+ // incomplete code.
+ "-bugprone-unchecked-optional-access",
// ----- Performance problems -----
|
@@ -219,6 +219,9 @@ TidyProvider disableUnusableChecks(llvm::ArrayRef<std::string> ExtraBadChecks) { | |||
"-bugprone-use-after-move", | |||
// Alias for bugprone-use-after-move. | |||
"-hicpp-invalid-access-moved", | |||
// Check uses dataflow analysis, which might hang/crash unexpectedly on | |||
// incomplete code. | |||
"-bugprone-unchecked-optional-access", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A consequence of putting the check here, is that a user who wants the check in spite of its bugginess does not have a way to enable it.
It was suggested, in clangd/clangd#1700 (comment) and clangd/clangd#1337 (comment), that we should have a way to allow users to override the disablements in this "bad checks" list. Could you weigh in on that proposal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, we had this check enabled internally before it was upstream'd and experience on incomplete code has always been problematic. Hence I don't see much point in letting people run this on an incomplete AST. I believe the recommended workflow should be through running clang-tidy binary directly. I'll add some comments on those threads too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I commented in clangd/clangd#1337 (comment) about users maybe asking for an override in the future, but for now, avoiding the much more common case of users who don't care about this checker being burned by its brittleness is definitely the more pressing concern.
thanks for the pointers @HighCommander4 ! |
This may be a good candidate for a 17.0.x backport. |
yeah, initiated that (i think) already in #69568 |
Fixes #69369. Fixes clangd/clangd#1700. (cherry picked from commit e63ab13)
Fixes #69369.
Fixes clangd/clangd#1700.