Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[clang-tidy] modernize-use-digit-separator issue #35414 #76153

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

Open
wants to merge 78 commits into
base: main
Choose a base branch
Loading
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
3b83f86
Add empty files for use-digit-separator-check
IvanArkhipov1999 Dec 2, 2023
0560b3c
Finding integer value
IvanArkhipov1999 Dec 2, 2023
7e64853
Splitting integer string by 3 digits
IvanArkhipov1999 Dec 3, 2023
43f66ac
Formatting
IvanArkhipov1999 Dec 3, 2023
3a36679
Checking formatting of integer literal
IvanArkhipov1999 Dec 4, 2023
524aa8b
Messages of checking formatting integer literals
IvanArkhipov1999 Dec 4, 2023
78b1bf1
Support for various number systems
IvanArkhipov1999 Dec 4, 2023
9d4430d
Support for octal number system
IvanArkhipov1999 Dec 4, 2023
d80dbbe
Formatting
IvanArkhipov1999 Dec 4, 2023
4bd9517
Support integer literals with postfix
IvanArkhipov1999 Dec 5, 2023
c97e527
Begin of work with float literals
IvanArkhipov1999 Dec 5, 2023
544d9f8
Begin of work with float literals
IvanArkhipov1999 Dec 5, 2023
8115148
Fix clang tidy
IvanArkhipov1999 Dec 5, 2023
c9091cb
Crazy (dirty) support for float literals
IvanArkhipov1999 Dec 5, 2023
ceb711a
Formatting
IvanArkhipov1999 Dec 5, 2023
6b933a9
Getting float value string
IvanArkhipov1999 Dec 10, 2023
e66e180
Some refactoring
IvanArkhipov1999 Dec 10, 2023
0092c07
Formating
IvanArkhipov1999 Dec 10, 2023
e7fddc9
Support of format postfixes of floats
IvanArkhipov1999 Dec 10, 2023
e42ba55
Formatting
IvanArkhipov1999 Dec 10, 2023
28838f1
Empty test
IvanArkhipov1999 Dec 10, 2023
9a9fa52
Simple test
IvanArkhipov1999 Dec 11, 2023
9ddfb12
Add some tests
IvanArkhipov1999 Dec 12, 2023
04e4091
Add tests with minus
IvanArkhipov1999 Dec 12, 2023
9152e1e
Delete postfixes
IvanArkhipov1999 Dec 12, 2023
b6f82b9
Merge branch 'main' into modernize-use-digit-separator
IvanArkhipov1999 Dec 12, 2023
e175e70
Return postfixes
IvanArkhipov1999 Dec 14, 2023
c840c98
Support long postfixes
IvanArkhipov1999 Dec 14, 2023
43f53c5
Format
IvanArkhipov1999 Dec 14, 2023
977e689
Using getFormatedLiteralString
IvanArkhipov1999 Dec 14, 2023
68d0707
Renaming
IvanArkhipov1999 Dec 14, 2023
a7064ec
Create getFormatedFloatString
IvanArkhipov1999 Dec 15, 2023
9edf9f5
Refactor getFormatedFloatString
IvanArkhipov1999 Dec 15, 2023
5b4460b
Formating
IvanArkhipov1999 Dec 15, 2023
d59adac
Add precision calculating
IvanArkhipov1999 Dec 18, 2023
15627d1
Formating
IvanArkhipov1999 Dec 18, 2023
ba22e57
Scientific form of literal support
IvanArkhipov1999 Dec 18, 2023
bde206f
Some refactoring and tests
IvanArkhipov1999 Dec 18, 2023
8897400
Formating
IvanArkhipov1999 Dec 18, 2023
260e096
Fix warning message for float values
IvanArkhipov1999 Dec 18, 2023
808e95c
Some refactoring
IvanArkhipov1999 Dec 19, 2023
c22c94b
Formating
IvanArkhipov1999 Dec 19, 2023
b80f6a1
Support signs in exponent notation
IvanArkhipov1999 Dec 19, 2023
9726be5
Formating
IvanArkhipov1999 Dec 19, 2023
1e00d39
Some tests and fixes
IvanArkhipov1999 Dec 19, 2023
5081470
Formatting
IvanArkhipov1999 Dec 19, 2023
f929f69
Add more tests
IvanArkhipov1999 Dec 19, 2023
6fd7991
Add more tests
IvanArkhipov1999 Dec 19, 2023
78d5419
Formating
IvanArkhipov1999 Dec 19, 2023
fdea346
Add tests for Formatted literals
IvanArkhipov1999 Dec 21, 2023
f8446ab
Add tests for wrong Formatted literals
IvanArkhipov1999 Dec 21, 2023
11f8091
Delete tests for wrong Formatted literals
IvanArkhipov1999 Dec 21, 2023
f754d54
Add docs
IvanArkhipov1999 Dec 21, 2023
ab6dedf
Formatting
IvanArkhipov1999 Dec 21, 2023
1db3de8
Merge branch 'main' into modernize-use-digit-separator
IvanArkhipov1999 Dec 21, 2023
e31f05f
Formatting
IvanArkhipov1999 Dec 21, 2023
b3624ce
Formatting
IvanArkhipov1999 Dec 21, 2023
93f1885
Documentation
IvanArkhipov1999 Dec 21, 2023
004f02e
Add include sstream
IvanArkhipov1999 Dec 21, 2023
dd09ad2
Fix some tests
IvanArkhipov1999 Dec 26, 2023
91b7ff1
Remove using streams
IvanArkhipov1999 Dec 26, 2023
aaaac01
Formatting
IvanArkhipov1999 Dec 26, 2023
2ded896
Fix scientific notation bug
IvanArkhipov1999 Dec 26, 2023
c157fab
Formatting
IvanArkhipov1999 Dec 26, 2023
8bb32be
Add tests for long wrong formatted literals
IvanArkhipov1999 Dec 26, 2023
42a1809
Write required c++ version in docs
IvanArkhipov1999 Dec 26, 2023
57d8e57
Fix check fix and add tests with assignment expression.
IvanArkhipov1999 Dec 27, 2023
4675cfa
Formatting
IvanArkhipov1999 Dec 27, 2023
7253f4b
Use llvm_unreachable
IvanArkhipov1999 Dec 27, 2023
5c0f524
Change message for floating literals
IvanArkhipov1999 Dec 27, 2023
e6e2e2c
Replace std::basic_string<char> by std::string
IvanArkhipov1999 Dec 27, 2023
58a224d
Formatting
IvanArkhipov1999 Dec 27, 2023
c54ad24
Awful code for macros
IvanArkhipov1999 Jan 9, 2024
656b46d
Formatting
IvanArkhipov1999 Jan 9, 2024
fa94bb4
Add some tests and fixes
IvanArkhipov1999 Jan 9, 2024
c5ec616
Support binary numbers in macros
IvanArkhipov1999 Jan 9, 2024
a4110d8
Support oct and hex numbers in macros
IvanArkhipov1999 Jan 9, 2024
dcff84f
Formatting
IvanArkhipov1999 Jan 9, 2024
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
Prev Previous commit
Next Next commit
Support oct and hex numbers in macros
  • Loading branch information
IvanArkhipov1999 committed Jan 9, 2024
commit a4110d8978500b83e554e8ab9038852b282584da
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,10 @@ void UseDigitSeparatorCallbacks::MacroDefined(const Token &MacroNameTok,
std::string BinaryNumber = OriginalLiteralString;
BinaryNumber.erase(0, 2);
IntegerValue = llvm::APInt(128, std::stoul(BinaryNumber, nullptr, 2));
} else if (llvm::StringRef(OriginalLiteralString).starts_with("0x")) {
IntegerValue = llvm::APInt(128, std::stoul(OriginalLiteralString, nullptr, 16));
} else if (llvm::StringRef(OriginalLiteralString).starts_with("0")) {
IntegerValue = llvm::APInt(128, std::stoul(OriginalLiteralString, nullptr, 8));
} else {
IntegerValue = llvm::APInt(128, std::stoul(OriginalLiteralString));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,3 +543,19 @@ double AssignmentPostfixScientificNotFormattedFloat4 = -1.2345678e-10F;
#define MINUS_BINARY_NOT_FORMATTED_INTEGER -0b11101101
// CHECK-MESSAGES: :[[@LINE-1]]:45: warning: unformatted representation of integer literal '0b11101101' [modernize-use-digit-separator]
// CHECK-FIXES: 0b1110'1101

#define OCT_NOT_FORMATTED_INTEGER 037512
// CHECK-MESSAGES: :[[@LINE-1]]:35: warning: unformatted representation of integer literal '037512' [modernize-use-digit-separator]
// CHECK-FIXES: 037'512

#define MINUS_OCT_NOT_FORMATTED_INTEGER -037512
// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: unformatted representation of integer literal '037512' [modernize-use-digit-separator]
// CHECK-FIXES: 037'512

#define HEX_NOT_FORMATTED_INTEGER 0x4f356
// CHECK-MESSAGES: :[[@LINE-1]]:35: warning: unformatted representation of integer literal '0x4f356' [modernize-use-digit-separator]
// CHECK-FIXES: 0x4'F356

#define MINUS_HEX_NOT_FORMATTED_INTEGER -0x4f356
// CHECK-MESSAGES: :[[@LINE-1]]:42: warning: unformatted representation of integer literal '0x4f356' [modernize-use-digit-separator]
// CHECK-FIXES: 0x4'F356
Morty Proxy This is a proxified and sanitized view of the page, visit original site.