[clang-tidy] Add check for initialization of `absl::Cleanup`.
authorCJ Johnson <johnsoncj@google.com>
Mon, 8 Nov 2021 15:40:18 +0000 (15:40 +0000)
committerYitzhak Mandelbaum <yitzhakm@google.com>
Mon, 8 Nov 2021 15:57:32 +0000 (15:57 +0000)
commit16b07c866ae74e0d02038574fe1c37a6cb55e233
treee1bd05c1ab7107e241deecb2c7f233eef633d657
parent79f52af4cd9a76485dd50bcdbb5d393eb7a70103
[clang-tidy] Add check for initialization of `absl::Cleanup`.

Suggests switching the initialization pattern of `absl::Cleanup` instances from the factory function to class template argument deduction (CTAD) in C++17 and higher.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D113195
clang-tools-extra/clang-tidy/abseil/AbseilTidyModule.cpp
clang-tools-extra/clang-tidy/abseil/CMakeLists.txt
clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/abseil/CleanupCtadCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/abseil-cleanup-ctad.rst [new file with mode: 0644]
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/test/clang-tidy/checkers/abseil-cleanup-ctad.cpp [new file with mode: 0644]