History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 101 – 125 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# bbae59ae 29-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Finalize children after formatting them (#73753)

This would also fix the overlapping replacements below:
```
$ clang-format
a(
#else
#endif
) = []() {
)}
The new repl

[clang-format] Finalize children after formatting them (#73753)

This would also fix the overlapping replacements below:
```
$ clang-format
a(
#else
#endif
) = []() {
)}
The new replacement overlaps with an existing replacement.
New replacement: <stdin>: 38:+7:"
"
Existing replacement: <stdin>: 38:+7:" "
```
Fixed #73487.

show more ...


Revision tags: llvmorg-17.0.6
# 39faf13d 27-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Add BreakAdjacentStringLiterals option (#73432)

Closes #70451.


# a369a594 27-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in formating `#define A x:` (#73220)

Fixed #70789.


# edad025d 19-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Correctly annotate braces of empty functions (#72733)

Also fixed some existing test cases.

Fixed #57305.
Fixed #58251.


# e16a8344 19-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Skip alignArrayInitializers() for 1-row matrices (#72166)


# 5679f551 17-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix crashes in AlignArrayOfStructures (#72520)

Fixed #54815.
Fixed #55269.
Fixed #55493.
Fixed #68431.


Revision tags: llvmorg-17.0.5
# a8528693 14-Nov-2023 Gedare Bloom <gedare@rtems.org>

[clang-format] Fix a bug in parsing function/variable names

Function and variable names are not detected when there is a
__attribute__((x)) preceding the name.

Fixes #64137.

Differential Revision:

[clang-format] Fix a bug in parsing function/variable names

Function and variable names are not detected when there is a
__attribute__((x)) preceding the name.

Fixes #64137.

Differential Revision: https://reviews.llvm.org/D156370

show more ...


# fff993b7 13-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in aligning comments in vector of structs (#72099)

Fixed #71825.


# 40671bbd 12-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle control statements in BreakAfterAttributes (#71995)

This patch doesn't work for do-while loops.

Fixed #64474.


# 199fc973 10-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle variable declarations in BreakAfterAttributes (#71935)

Also fixed a bug in `isStartOfName()` and cleaned up some old test
cases.

Fixed #71563.

This is a rework of #71755.


# 86ef9d36 10-Nov-2023 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)"

This reverts commit f7bbb58690910a8320b0927525dfba19df69a910 which caused
another formatting failure in polly.


# f7bbb586 10-Nov-2023 Owen Pan <owenpiano@gmail.com>

Reland "[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)"

Also fixed another bug in isStartOfName().


# a0710e16 10-Nov-2023 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)"

This reverts commit 5c36f4332d93c6f9bd9b01a34149a635e07a00d3 which caused a
formatting error in polly.


# 5c36f433 10-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle variable declarations in BreakAfterAttributes (#71755)

Also cleaned up some old test cases.

Fixes #71563.


# 2c2fb8e1 02-Nov-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Treat empty for/while loops as short loops (#70768)

A for/while loop with only a semicolon as its body should be treated as
an empty loop.

Fixes #61708.


Revision tags: llvmorg-17.0.4
# 497b2ebb 28-Oct-2023 Vlad Serebrennikov <serebrennikov.vladislav@gmail.com>

[clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (#70360)

This patch addresses some examples of bad formatting in Clang. The following commit contains only changes suggested by

[clang-format] Change LLVM style to BreakAfterAttributes == ABS_Leave (#70360)

This patch addresses some examples of bad formatting in Clang. The following commit contains only changes suggested by clang-format: https://github.com/llvm/llvm-project/pull/70349/commits/21689b56d1fc1db0b2263e8049ff656d3757ad36.
I believe it's a net negative on readability, with a couple of particularly bad cases. Highlights:
```diff
- [[clang::preferred_type(bool)]]
- mutable unsigned CachedLocalOrUnnamed : 1;
+ [[clang::preferred_type(bool)]] mutable unsigned CachedLocalOrUnnamed : 1;
```
```diff
- [[clang::preferred_type(TypeDependence)]]
- unsigned Dependence : llvm::BitWidth<TypeDependence>;
+ [[clang::preferred_type(TypeDependence)]] unsigned Dependence
+ : llvm::BitWidth<TypeDependence>;
```
```diff
- [[clang::preferred_type(ExceptionSpecificationType)]]
- unsigned ExceptionSpecType : 4;
+ [[clang::preferred_type(
+ ExceptionSpecificationType)]] unsigned ExceptionSpecType : 4;
```
Style guides doesn't appear to have an opinion on this matter.

show more ...


# 69209e30 25-Oct-2023 Backl1ght <backlight.zzk@gmail.com>

[clang-format] AllowShortCompoundRequirementOnASingleLine

clang-format brace wrapping did not take requires into consideration,
compound requirements will be affected by BraceWrapping.AfterFunction.

[clang-format] AllowShortCompoundRequirementOnASingleLine

clang-format brace wrapping did not take requires into consideration,
compound requirements will be affected by BraceWrapping.AfterFunction.

Closes #59412.

Differential Revision: https://reviews.llvm.org/D139834

show more ...


# d68826df 24-Oct-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Don't break between string literal operands of << (#69871)

Fixes #44363.


# 7bc1031c 24-Oct-2023 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format] Fix align consecutive declarations over function pointers"

This reverts commit a84e0b4bdc9999872adbdaafbade8164b197784b.

Fixes #68079.


# 853fb0a8 23-Oct-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Don't alter SpacesRequiredBefore of finalized tokens (#69897)

Fixes #69237.


# 7c15dd60 20-Oct-2023 Omar Ahmed <omarpiratee2010@gmail.com>

[clang-format] Add space in placement new expression

Add AfterPlacementNew option to SpaceBeforeParensOptions to have more
control on placement new expressions.

Fixes #41501
Relates to #54703

Diff

[clang-format] Add space in placement new expression

Add AfterPlacementNew option to SpaceBeforeParensOptions to have more
control on placement new expressions.

Fixes #41501
Relates to #54703

Differential Revision: https://reviews.llvm.org/D127270

show more ...


Revision tags: llvmorg-17.0.3
# 7f881a2a 10-Oct-2023 Jared Grubb <jgrubb@apple.com>

[clang-format] Treat AttributeMacro more like __attribute__

There are two parts to this fix:
- Annotate the paren after an AttributeMacro as an AttributeLParen.
- Treat an AttributeMacro-without-par

[clang-format] Treat AttributeMacro more like __attribute__

There are two parts to this fix:
- Annotate the paren after an AttributeMacro as an AttributeLParen.
- Treat an AttributeMacro-without-paren the same as one with a paren.

I added a new test-case to differentiate a macro that is or is-not an
AttributeMacro; also handled whether ColumnLimit is set to infinite (0) or a
finite value, as part of this patch is in ContinuationIndenter.

Closes #68722.

Differential Revision: https://reviews.llvm.org/D145262

show more ...


# 7e856d18 04-Oct-2023 Owen Pan <owenpiano@gmail.com>

Reland "[clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (#67955)"

Reland 6a621ed8e4cb which failed on Windows but not macOS.

The failures were caused by moving the annotation of the

Reland "[clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (#67955)"

Reland 6a621ed8e4cb which failed on Windows but not macOS.

The failures were caused by moving the annotation of the children from the
top to the bottom of TokenAnnotator::annotate(), resulting in invalid lines
including incomplete ones being skipped.

show more ...


# d08fcc81 04-Oct-2023 Owen Pan <owenpiano@gmail.com>

Revert "[clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (#67955)"

This reverts commit 6a621ed8e4cb02bd55fe4a4a0254615576b70a55 as it caused
buildbots to fail.


# 6a621ed8 04-Oct-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (#67955)

After annotating constructors/destructors as FunctionDeclarationName in
commit 08630512088, we have seen several issues beca

[clang-format] Annotate ctors/dtors as CtorDtorDeclName instead (#67955)

After annotating constructors/destructors as FunctionDeclarationName in
commit 08630512088, we have seen several issues because ctors/dtors had
been treated differently than functions in aligning, wrapping, and
indenting.

This patch annotates ctors/dtors as CtorDtorDeclName instead and would
effectively revert commit 0468fa07f87f, which is obsolete now.

Fixed #67903.
Fixed #67907.

show more ...


12345678910>>...82