See
https://timsong-cpp.github.io/cppwp/n4868/dcl.init#list-4
This eliminates a false positive in bugprone-use-after-move; this newly added
test used to be falsely classified as a use-after-move:
A a; S3 s3{a.getInt(), std::move(a)};
Differential D148110
[clang-tidy] bugprone-use-after-move: Ctor arguments should be sequenced if ctor call is written as list-initialization. mboehme on Apr 12 2023, 3:57 AM. Authored by
Details See https://timsong-cpp.github.io/cppwp/n4868/dcl.init#list-4 This eliminates a false positive in bugprone-use-after-move; this newly added A a; S3 s3{a.getInt(), std::move(a)};
Diff Detail
Event Timeline
Comment Actions The commit message doesn't really tell me "what" this commit is fixing, it only points to a section of the Standard. It talks about "a false positive" but it doesn't tell what this FP is about. Could you write a little bit more about what the problem is? Preferably if you can link a Github issue describing the problem. The subject of the commit message should indicate which particular check it relates to. Document change in release notes. Comment Actions Tests in lines 1195, 1201 actually tests InitListExpr. Comment Actions I've expanded the patch description to reference the specific test added here that used to be falsely diagnosed as a use-after-free. I hope this is acceptable in lieu of a github issue?
Done.
Done. That's understood. (These tests existed before this patch.)
Good point, done.
Comment Actions Reworded release notes.
Comment Actions Sorry, missed your LGTM. Will wait for pre-merge checks to complete and will then land. |
I just pointing this because I don't like this "check: Also"