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
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
Replace std::basic_string<char> by std::string
  • Loading branch information
IvanArkhipov1999 committed Dec 27, 2023
commit e6e2e2c5f8e5e0a2ae6aed748c6094b38371b525
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ namespace {
std::string
getFormatedScientificFloatString(const llvm::StringRef OriginalLiteralString);

std::vector<std::basic_string<char>>
splitStringByGroupSize(const std::basic_string<char> &String,
std::vector<std::string>
splitStringByGroupSize(const std::string &String,
size_t GroupSize) {
std::vector<std::basic_string<char>> Result;
std::basic_string<char> ReversedString(String.rbegin(), String.rend());
std::vector<std::string> Result;
std::string ReversedString(String.rbegin(), String.rend());

for (size_t I = 0; I < ReversedString.size(); I += GroupSize) {
Result.push_back(ReversedString.substr(I, GroupSize));
}

std::reverse(Result.begin(), Result.end());
std::for_each(Result.begin(), Result.end(), [](std::basic_string<char> &Str) {
std::for_each(Result.begin(), Result.end(), [](std::string &Str) {
return std::reverse(Str.begin(), Str.end());
});

Expand Down Expand Up @@ -82,8 +82,8 @@ getFormatedIntegerString(const llvm::StringRef OriginalLiteralString,
Prefix +
std::accumulate(SplittedIntegerLiteral.begin(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::accumulate isn't efficient, better simply create empty std::string, use reserve, and then append all strings in simple loop.

SplittedIntegerLiteral.end(), std::string(""),
[](std::basic_string<char> S1,
std::basic_string<char> S2) { return S1 + "\'" + S2; })
[](std::string S1,
std::string S2) { return S1 + "\'" + S2; })
.erase(0, 1) +
Postfix;

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.