10 Commits

Author SHA1 Message Date
Owen Pan
5fc482cfc0
[clang-format] Disable IntegerLiteralSeparator for C++ before c++14 (#151273)
Fixes #151102
2025-07-30 09:43:46 -07:00
Owen Pan
4d48996ff0
[clang-format][NFC] Clean up around StringRef initializations (#149765)
Consistently use `constexpr StringRef Code("string literal");`.
2025-07-21 19:11:17 -07:00
Owen Pan
a72b064acf [clang-format] Handle <chrono> ud suffixes in IntegerLiteralSeparator
Fixes #62679.

Differential Revision: https://reviews.llvm.org/D150539
2023-05-16 13:17:31 -07:00
Owen Pan
253985d58c [clang-format] Add MinDigits suboptions to IntegerLiteralSeparator
Closes #61209.

Differential Revision: https://reviews.llvm.org/D147111
2023-03-31 17:14:33 -07:00
Owen Pan
4d21868b09 [clang-format] Handle '_' in ud-suffix for IntegerLiteralSeparator
Also, handle imaginary numbers, i.e., those with suffixes starting
with an 'i'.

Fixes #61676.

Differential Revision: https://reviews.llvm.org/D146844
2023-03-28 13:13:02 -07:00
Manuel Klimek
f8d10d5ac9 [clang-format][NFC] Refactor formatting unit tests.
Pull out common base class for formatting unit tests, removing duplicate
code that accumulated over the years.

Pull out macro expansion test into its own test file.
2023-03-01 12:36:07 +00:00
Owen Pan
89aad1e6a3 Reland [clang-format] Add an option to format integer literal separators
Previously committed in 46c94e5067b5 which was reverted in f0756e086010
due to a memory bug.

Closes #58949.

Differential Revision: https://reviews.llvm.org/D140543
2022-12-31 17:57:33 -08:00
Vitaly Buka
f0756e0860 Revert "[clang-format] Add an option to format integer literal separators"
Revert "[clang-format] Disable FixRanges in IntegerLiteralSeparatorTest"

Breaks buildbots, details in https://reviews.llvm.org/D140543

This reverts commit 879bd9146a2c9ea395abd7c1ebd0f76f414a4967.
This reverts commit 46c94e5067b5f396c24bb950505c79bc819bd4b8.
2022-12-25 13:04:41 -08:00
Owen Pan
879bd9146a [clang-format] Disable FixRanges in IntegerLiteralSeparatorTest
The FixRanges unit test from 46c94e5067b5 breaks the build bots.
Disable it for now.
2022-12-24 18:55:24 -08:00
Owen Pan
46c94e5067 [clang-format] Add an option to format integer literal separators
Closes #58949.

Differential Revision: https://reviews.llvm.org/D140543
2022-12-24 15:35:17 -08:00