[clang-tidy] add modernize-use-std-numbers (#66583)
commit0eb7d53cfc48f2e9287bb116415620618ca850b7
authorJulian Schmidt <44101708+5chmidti@users.noreply.github.com>
Wed, 6 Dec 2023 17:56:05 +0000 (6 18:56 +0100)
committerPiotr Zegar <me@piotrzegar.pl>
Wed, 6 Dec 2023 20:49:14 +0000 (6 20:49 +0000)
tree58b17a1a4bff264680e8ee489722377cd1609c47
parentb4e19155171edf14412dc4132b7b10a84ac65fc5
[clang-tidy] add modernize-use-std-numbers (#66583)

Finds constants and function calls to math functions that can be
replaced with c++20's mathematical constants from the 'numbers'
header and offers fix-it hints.
Does not match the use of variables with that value, and instead,
offers a replacement at the definition of those variables.
clang-tools-extra/clang-tidy/modernize/CMakeLists.txt
clang-tools-extra/clang-tidy/modernize/ModernizeTidyModule.cpp
clang-tools-extra/clang-tidy/modernize/UseStdNumbersCheck.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/modernize/UseStdNumbersCheck.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/use-std-numbers.rst [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-numbers.cpp [new file with mode: 0644]