[clang-tidy] Make readability-container-size-empty check using <string> header
authorMike Crowe <mac@mcrowe.com>
Sun, 12 Mar 2023 13:32:29 +0000 (13:32 +0000)
committerPiotr Zegar <piotr.zegar@nokia.com>
Sun, 12 Mar 2023 13:32:29 +0000 (13:32 +0000)
commit0a93abd9765809bb13cfdb43794bf17e9ad5e137
tree8320ae27804c879bc1fa3cc45555d8cf46b26e68
parentf9dc14cf1f7eadffa7b11b86aaeaee5af26a21c0
[clang-tidy] Make readability-container-size-empty check using <string> header

Improve the generic <string> header by adding the size() method so that
it can be used to replace the custom implementation in the
readability-container-size-empty check.

This requires fixing an incorrect comparison of a std::wstring with a
char string literal.

Unfortunately, removing the custom basic_string implementation means
fixing the line numbers for many of the checks.

Depends on D145312

Reviewed By: PiotrZSL

Differential Revision: https://reviews.llvm.org/D145313
clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/string
clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp