[clang-tools-extra] [clang-tidy] add modernize-math-constant check (PR #66583)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 16 11:37:28 PDT 2023


PiotrZSL wrote:

> Sure thing. I don't have a strong feeling about the category.

I'ts not only about category but also name, check suggests std::numbers, then better name it modernize-use-std-numbers, reason for that is simple. Before C++20 we may want to have a check for example <something>-prefer-math-constants that would change 3.14 hardcoded in code into M_PI. And in same way we could have check <something>-use-std-numeric-limits that would change -2147483648 into std::numeric_limits<std::sint32_t>::min(). Simply we may have many of such checks.

https://github.com/llvm/llvm-project/pull/66583


More information about the cfe-commits mailing list