[clang-tidy] Add checker 'bugprone-suspicious-realloc-usage'.
authorBalázs Kéri <1.int32@gmail.com>
Tue, 4 Oct 2022 06:43:35 +0000 (08:43 +0200)
committerBalázs Kéri <1.int32@gmail.com>
Tue, 4 Oct 2022 07:14:46 +0000 (09:14 +0200)
commit6d9eb533291377979882ac9674431eddd1248445
tree98a9fe0e74c9ac7403c3e42cca1c735de54a6fab
parent46869eebdc548baa5a8707d03ddd8195b76dcd70
[clang-tidy] Add checker 'bugprone-suspicious-realloc-usage'.

Add a check to detect usages of `realloc` where the result is assigned
to the same variable (or field) as passed to the first argument.

Reviewed By: steakhal, martong

Differential Revision: https://reviews.llvm.org/D133119
clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
clang-tools-extra/clang-tidy/bugprone/SuspiciousReallocUsageCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/bugprone/SuspiciousReallocUsageCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone/suspicious-realloc-usage.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/checkers/bugprone/suspicious-realloc-usage.cpp [new file with mode: 0644]