Detect comparison between string and empty string_literals.
Fixes #64547
Paths
| Differential D158346
[clang-tidy] readability-container-size-empty - detect missing usage of .empty() on string_literals ClosedPublic Authored by felix642 on Aug 19 2023, 12:13 PM. Tokens "Like" token, awarded by PiotrZSL.
Details Summary Detect comparison between string and empty string_literals. Fixes #64547
Diff Detail
Event TimelineComment Actions
This revision now requires changes to proceed.Aug 19 2023, 12:30 PM Comment Actions Hi @PiotrZSL, thank you for the feedback. I have addressed most of your comments, but I'm not sure to understand what you mean by "Commit/Change description should be updated". Would you be able to clarify that for me? This revision is now accepted and ready to land.Aug 19 2023, 2:29 PM PiotrZSL retitled this revision from [clang-tidy] [readability-container-size-empty] improved check to detect missing usage of .empty() on string_literals Fixes #64547 to [clang-tidy] readability-container-size-empty - detect missing usage of .empty() on string_literals .Aug 21 2023, 10:42 AM Closed by commit rG4001ae175cbe: [clang-tidy] readability-container-size-empty - detect missing usage of .empty… (authored by felix642, committed by PiotrZSL). · Explain WhyAug 21 2023, 10:48 AM This revision was automatically updated to reflect the committed changes. rnk added inline comments.
Revision Contents
Diff 552080 clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp
|
Probably best would be to write matcher like this:
and use it instead of hasDescendant