10 Commits

Author SHA1 Message Date
Baranov Victor
5325f2b930
[clang-tidy][NFC] Enable 'performance-move-const-arg' in '.clang-tidy' config (#148549)
Set `performance-move-const-arg.CheckTriviallyCopyableMove` option to
`false` because "trivially copyable" is too strict and give warning for
e.g. `MixData` class:
1fbfa333f6/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp (L389)
Here:

1fbfa333f6/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp (L504-L505)
I find `std::move` here useful.
2025-08-03 13:18:24 +03:00
Kazu Hirata
e00693659b
[clang-tidy] Use llvm::less_second (NFC) (#136396) 2025-04-18 20:34:01 -07:00
Tommy Chen
d22d14375d
[clang-tidy] support different precisions (#130540)
Support float and long double versions of the math functions for
UseStdNumbersCheck.
For example, after this commit the check is able to catch `sqrtf(2)` and
`expl(1)`.

Fixes: #130325
2025-03-11 18:05:01 +01:00
Zentrik
a5f54175dc
Include cmath to fix build error on mac os 10.14 (#88665)
This fixes #88664.
2024-04-15 00:21:06 +02:00
Piotr Zegar
e1fa2fea03 [clang-tidy][NFC] Change ArrayRef into std::vector in modernize-use-std-numbers
To avoid compiler errors on some platforms introduced
by #66583, now using std::vector to pass list of
matchers into main matcher, and removed static variable
as it could introduce some other issues.
2023-12-06 20:50:48 +00:00
Julian Schmidt
0eb7d53cfc [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.
2023-12-06 20:49:14 +00:00
Piotr Zegar
1e1e11a4d7 Revert "[clang-tidy] add modernize-use-std-numbers (#66583)"
Compilation issue, to be resolved.

This reverts commit 3f73fd774cf8fc2f288767ea077bfa351eb7aa80.
2023-12-06 18:59:25 +00:00
Piotr Zegar
7deb41db98 Revert "[clang-tidy][NFC] Attemp to fix compliation issue in UseStdNumbersCheck.cpp"
This reverts commit bb0b261c2c731f9ceb5a70b2343b892b2ee05f3e.
2023-12-06 18:59:25 +00:00
Piotr Zegar
bb0b261c2c [clang-tidy][NFC] Attemp to fix compliation issue in UseStdNumbersCheck.cpp
Attempt to fix issue introduced in #66583
2023-12-06 18:47:59 +00:00
Julian Schmidt
3f73fd774c
[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.
2023-12-06 18:56:05 +01:00