This is an archive of the discontinued LLVM Phabricator instance.

[Clang-tidy] Make readability-container-size-empty working with STL string
AbandonedPublic

Authored by Eugene.Zelenko on Feb 18 2016, 6:45 PM.

Details

Summary

While working with LLDB code I noticed that readability-container-size-empty doesn't detect problems with STL string, so this my attempt to fix problem.

Build and regressions were OK on RHEL 6.

Diff Detail

Repository
rL LLVM

Event Timeline

Eugene.Zelenko retitled this revision from to [Clang-tidy] Make readability-container-size-empty working with STL string.
Eugene.Zelenko updated this object.
Eugene.Zelenko set the repository for this revision to rL LLVM.
Eugene.Zelenko added a subscriber: cfe-commits.

should probably have test coverage

aaron.ballman edited edge metadata.Feb 19 2016, 7:54 AM

I agree with David, I'd like to see test coverage for this (with both std::string and std::wstring to be paranoid).

Also I agree that testing is good idea, it doesn't make sense in current incarnation which test only vector and set and only with containers' code snippets instead of real implementations. I wrote about last issue in cfe-dev, but idea was rejected.

Other issue is how to avoid code duplication for test conditions. Probably tests should be generated from templates for each container or should contain container definition and include shared test body.

alexfh edited edge metadata.Feb 19 2016, 6:52 PM

should probably have test coverage

+1

alexfh requested changes to this revision.Feb 24 2016, 5:45 AM
alexfh edited edge metadata.
This revision now requires changes to proceed.Feb 24 2016, 5:45 AM
jbcoe added a subscriber: jbcoe.Mar 1 2016, 12:24 PM
Eugene.Zelenko abandoned this revision.Apr 7 2016, 11:41 AM