Lint and fix bugprone-use-after-move violations#35978
Lint and fix bugprone-use-after-move violations#35978auto-submit[bot] merged 8 commits intoflutter:mainfrom
bugprone-use-after-move violations#35978Conversation
gaaclarke
left a comment
There was a problem hiding this comment.
Awesome, LGTM. I thought we had this on already. I remember fixing the issue when I first implemented the linter. My only concern was its inability to figure out the ternary operator case. I don't want to accept worse performance to make the linter happy.
| ? Push<DrawSkPictureMatrixOp>(0, 1, std::move(picture), *matrix, | ||
| ? Push<DrawSkPictureMatrixOp>(0, 1, picture, *matrix, | ||
| render_with_attributes) | ||
| : Push<DrawSkPictureOp>(0, 1, std::move(picture), render_with_attributes); |
There was a problem hiding this comment.
This seems like a false alarm. Only one move is guaranteed to execute and this technically changes the performance for the worse.
There was a problem hiding this comment.
The problem isn't the ternary, it's that we reference picture on the line right under this.
There was a problem hiding this comment.
Ahh missed that, nice catch. LGTM.
There was a problem hiding this comment.
(Well, the line under the comments under this, which GitHub is cutting off by default :)
|
|
||
| lazy_glyph_atlas->AddTextFrame(std::move(text_frame)); | ||
| lazy_glyph_atlas->AddTextFrame(text_frame); | ||
|
|
||
| auto text_contents = std::make_shared<TextContents>(); | ||
| text_contents->SetTextFrame(std::move(text_frame)); |
There was a problem hiding this comment.
How is this not a bug? This manifests as a bug right?
There was a problem hiding this comment.
@chinmaygarde may know. I don't understand how this ever worked :)
There's some lint in there that is checking for calling methods on |
bugprone-use-after-move violationsbugprone-use-after-move violations
|
auto label is removed for flutter/engine, pr: 35978, due to - The status or check suite Mac clang-tidy has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
auto label is removed for flutter/engine, pr: 35978, due to - The status or check suite Linux clang-tidy has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
There have been a few violations introduced by new commits as I'm writing this PR. If it happens to fail in post submit we should fix forward rather than reverting. The main culprit seems to be people copy/pasting something like |
|
auto label is removed for flutter/engine, pr: 35978, due to - The status or check suite Mac iOS Engine has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
From PR triage: This is blocked on the tree closure @ flutter/flutter#111193. |
)" This reverts commit 6279c78.
Fixes flutter/flutter#111135
Adds some ignores for tests that explicitly want to test behavior of use after move.