With 15f3cd6bfc670ba6106184a903eb04be059e5977, we no longer emit a
diagnostic on a real std::vector case where the size method returns a
sugar size_type. This patch fixes it.
std::vector<int> v; if (v.size() == 0) // => no check diagnostics ;
Paths
| Differential D131390
[clang-tidy] Fix a regression of readability-container-size-empty after the AST ElaboratedType change. ClosedPublic Authored by hokein on Aug 8 2022, 4:24 AM.
Details Summary With 15f3cd6bfc670ba6106184a903eb04be059e5977, we no longer emit a std::vector<int> v; if (v.size() == 0) // => no check diagnostics ;
Diff Detail
Event TimelineComment Actions Thanks! It makes me a little sad that QualType has both isIntegerType and isIntegralType. Nice spotting that difference! This revision is now accepted and ready to land.Aug 8 2022, 4:42 AM This revision was landed with ongoing or failed builds.Aug 8 2022, 5:41 AM Closed by commit rG7dc410cbff28: [clang-tidy] Fix a regression of readability-container-size-empty after the AST… (authored by hokein). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 450772 clang-tools-extra/clang-tidy/readability/ContainerSizeEmptyCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/readability/container-size-empty.cpp
|