[clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc
authorAdam Balogh <adam.balogh@ericsson.com>
Wed, 4 Dec 2019 09:48:13 +0000 (10:48 +0100)
committerAdam Balogh <adam.balogh@ericsson.com>
Tue, 21 Jan 2020 13:38:15 +0000 (14:38 +0100)
commitfccd0da5ee6f4e337395f287edcf824a009e1b7e
treeed77dff9a59b53b95c45064dc4df96471e5bde6d
parent5181c67febc8d4c69559055fe2bee086aae61996
[clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-alloc

Finds cases where an integer expression is added to the result
of a memory allocation function instead of its argument.

Differential Revision: https://reviews.llvm.org/D71001
clang-tools-extra/clang-tidy/bugprone/BugproneTidyModule.cpp
clang-tools-extra/clang-tidy/bugprone/CMakeLists.txt
clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/bugprone-misplaced-pointer-arithmetic-in-alloc.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/checkers/bugprone-misplaced-pointer-arithmetic-in-alloc.c [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/bugprone-misplaced-pointer-arithmetic-in-alloc.cpp [new file with mode: 0644]