Skip to content

[clang-tidy] add modernize-use-std-numbers #66583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 48 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
4273a2e
[clang-tidy] add modernize-use-std-numbers check
5chmidti Sep 16, 2023
3a3a989
address comments
5chmidti Sep 17, 2023
806f5f9
update descriptions slightly
5chmidti Sep 17, 2023
3eebecf
fixup update of warning message
5chmidti Sep 18, 2023
074375d
rename isMathMacro to isMacro
5chmidti Sep 25, 2023
6afbe26
add tests for uses in templates
5chmidti Sep 25, 2023
b0028ca
fix matcher names
5chmidti Sep 25, 2023
a7afcd8
fix name of custom matcher hasCanonicalTypeUnqualified
5chmidti Oct 7, 2023
af2b8bc
remove custom constants in favor of using llvm::numbers for all
5chmidti Oct 7, 2023
e0bc562
remove not needed argument for using a compile-time constant
5chmidti Oct 7, 2023
3e1874a
fix inv_pi and phi matchers matching uses of named constants
5chmidti Oct 7, 2023
6760bb8
change matches of macro defs to macro uses
5chmidti Oct 27, 2023
eba3e84
split matcher for float values
5chmidti Oct 27, 2023
efa2290
add test of using math marco on its own
5chmidti Oct 27, 2023
219a837
add newline after code-block directive to maybe fix docs ci
5chmidti Oct 27, 2023
0b58549
fix APFloat issue
5chmidti Oct 27, 2023
28c1576
run clang-include-cleaner
5chmidti Oct 27, 2023
4ddc585
rename chainedIfBound to applyRuleForBoundOrDefault
5chmidti Oct 28, 2023
6a7e757
add support for combinations of casts
5chmidti Nov 3, 2023
e01c418
check QualType::isNull in custom matchers
5chmidti Nov 3, 2023
9c4c2a6
refactor Dref match in matchFloatValueNear
5chmidti Nov 4, 2023
3a1e6ae
change Dref match in MatchValue
5chmidti Nov 4, 2023
3d73ce4
fix implicit casts in hasInitializer of matchValue
5chmidti Nov 4, 2023
99836ca
add test for int constants initialized with float
5chmidti Nov 4, 2023
93e93cc
extend documentation
5chmidti Nov 4, 2023
2168790
refactor from using transformer to a normal check
5chmidti Nov 10, 2023
483f913
change message to include what is being replaced and how far off lite…
5chmidti Nov 10, 2023
45bdd8c
add config value for DiffThreshold
5chmidti Nov 10, 2023
f31e7ab
use TK_IgnoreUnlessSpelledInSource
5chmidti Nov 11, 2023
05cfe95
rm duplicate canonicalization of expr type
5chmidti Nov 16, 2023
f275c4d
rm not needed parens
5chmidti Nov 16, 2023
8e5d0f7
declare PatternBindString in the if-init
5chmidti Nov 16, 2023
d8f8520
more const parameters
5chmidti Nov 16, 2023
dbb868d
init DiffThresholdString in the init list
5chmidti Nov 16, 2023
5c66e1e
add comment for isRangeOfCompleteMacro
5chmidti Nov 16, 2023
5cba501
add explicit tests for macro range check
5chmidti Nov 16, 2023
944cf91
instantiate big test template
5chmidti Nov 17, 2023
7671fb2
fix comment
5chmidti Nov 23, 2023
2e0318f
rm unless(isInTemplateInstantiation()), because of IgnoreUnlessSpelle…
5chmidti Nov 23, 2023
87e4bb2
fix literal in template problem in exchange for not resolving implici…
5chmidti Dec 2, 2023
963583c
move def of storeOptions to cpp file
5chmidti Dec 2, 2023
0b59b37
remove unused include
5chmidti Dec 2, 2023
284fa1b
add options to doc
5chmidti Dec 4, 2023
163bc15
address doc comments
5chmidti Dec 5, 2023
a4d53df
C++20
5chmidti Dec 5, 2023
ab7c766
double backtick elements in constants list
5chmidti Dec 5, 2023
2bf23ec
reflow docs for 80 char column limit
5chmidti Dec 5, 2023
5effa12
change at to for in sentence
5chmidti Dec 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang-tools-extra/clang-tidy/modernize/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ add_clang_library(clangTidyModernizeModule
UseNullptrCheck.cpp
UseOverrideCheck.cpp
UseStartsEndsWithCheck.cpp
UseStdNumbersCheck.cpp
UseStdPrintCheck.cpp
UseTrailingReturnTypeCheck.cpp
UseTransparentFunctorsCheck.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "UseNullptrCheck.h"
#include "UseOverrideCheck.h"
#include "UseStartsEndsWithCheck.h"
#include "UseStdNumbersCheck.h"
#include "UseStdPrintCheck.h"
#include "UseTrailingReturnTypeCheck.h"
#include "UseTransparentFunctorsCheck.h"
Expand Down Expand Up @@ -69,6 +70,8 @@ class ModernizeModule : public ClangTidyModule {
CheckFactories.registerCheck<PassByValueCheck>("modernize-pass-by-value");
CheckFactories.registerCheck<UseStartsEndsWithCheck>(
"modernize-use-starts-ends-with");
CheckFactories.registerCheck<UseStdNumbersCheck>(
"modernize-use-std-numbers");
CheckFactories.registerCheck<UseStdPrintCheck>("modernize-use-std-print");
CheckFactories.registerCheck<RawStringLiteralCheck>(
"modernize-raw-string-literal");
Expand Down
Loading