[all-commits] [llvm/llvm-project] 376168: [clang-tidy] Add modernize-type-traits check

Nathan James via All-commits all-commits at lists.llvm.org
Fri Apr 7 10:38:36 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 376168babb51aa08bc864d4797db4a6dbd53fdbc
      https://github.com/llvm/llvm-project/commit/376168babb51aa08bc864d4797db4a6dbd53fdbc
  Author: Nathan James <n.james93 at hotmail.co.uk>
  Date:   2023-04-07 (Fri, 07 Apr 2023)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/CMakeLists.txt
    M clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
    A clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.cpp
    A clang-tools-extra/clang-tidy/modernize/TypeTraitsCheck.h
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/list.rst
    A clang-tools-extra/docs/clang-tidy/checks/modernize/type-traits.rst
    A clang-tools-extra/test/clang-tidy/checkers/modernize/type-traits.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list