[PATCH] D144217: [clang-tidy] Fix false-positive in readability-container-size-empty

Piotr Zegar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 17 11:56:01 PST 2023


PiotrZSL created this revision.
Herald added subscribers: carlosgalvezp, xazax.hun.
Herald added a reviewer: njames93.
Herald added a project: All.
PiotrZSL added a comment.
Eugene.Zelenko added reviewers: aaron.ballman, carlosgalvezp.
PiotrZSL updated this revision to Diff 498450.
PiotrZSL published this revision for review.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

I may consider tomorrow moving `std::array` into into some dedicated option, like IgnoredContainersInComparisonRegexp


PiotrZSL added a comment.

Add configuration option. Release Notes + documentation for new option powered by ChatGPT.


PiotrZSL added a comment.

Ready for review


Ignoring std::array type when matching 'std:array == std::array()'.
In such case we shouldn't propose to use empty().

Fixes: https://github.com/llvm/llvm-project/issues/48286


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144217

Files:
  clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
  clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.h
  clang-tools-extra/docs/ReleaseNotes.rst
  clang-tools-extra/docs/clang-tidy/checks/readability/container-size-empty.rst
  clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144217.498450.patch
Type: text/x-patch
Size: 6204 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230217/04eaf773/attachment-0001.bin>


More information about the cfe-commits mailing list