[clang-tidy] Add modernize-type-traits check
authorNathan James <n.james93@hotmail.co.uk>
Fri, 7 Apr 2023 17:38:13 +0000 (18:38 +0100)
committerNathan James <n.james93@hotmail.co.uk>
Fri, 7 Apr 2023 17:38:15 +0000 (18:38 +0100)
commit376168babb51aa08bc864d4797db4a6dbd53fdbc
tree0ec7b132331e2d70f1096b71c9f66d618f26c147
parentf331e13d53c58703073f189195f99def5e3ff6c1
[clang-tidy] Add modernize-type-traits check

This check will look for usages of standard library type traits of the form `traits<...>::type` and `traits<...>::value` and convert them into `traits_t<...>` and `traits_v<...>` respectively.
This expands on the work in D135404 by supporting dependent traits with no instantiations as well as types.

Differential Revision: https://reviews.llvm.org/D137302
clang-tools-extra/clang-tidy/modernize/CMakeLists.txt
clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.h [new file with mode: 0644]
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/list.rst
clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/modernize/type-traits.cpp [new file with mode: 0644]