History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1 – 25 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# d50ebd47 28-Jan-2025 Gedare Bloom <gedare@rtems.org>

[clang-format] Add style option `PenaltyBreakBeforeMemberAccess` (#118409)

The penalty for breaking before a member access is hard-coded to 150.
Add a configuration option to allow setting it.

-

[clang-format] Add style option `PenaltyBreakBeforeMemberAccess` (#118409)

The penalty for breaking before a member access is hard-coded to 150.
Add a configuration option to allow setting it.

---------

Co-authored-by: Owen Pan <owenpiano@gmail.com>

show more ...


# 6330f1e0 24-Jan-2025 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a regression in `PointerAlignment: Left` (#124085)

Don't insert a space between a type declaration r_paren and &/&&.

Fixes #124073.


# 33656932 21-Jan-2025 Sirraide <aeternalmail@gmail.com>

[clang-format] Rename ExportBlockIndentation -> IndentExportBlock (#123493)

This renames the `ExportBlockIndentation` option and adds a config parse
test, as requested in #110381.


# 106c483a 18-Jan-2025 Sirraide <aeternalmail@gmail.com>

[clang-format] Improve brace wrapping and add an option to control indentation of `export { ... }` (#110381)

`export { ... }` blocks can get a bit long, so I thought it would make
sense to have an o

[clang-format] Improve brace wrapping and add an option to control indentation of `export { ... }` (#110381)

`export { ... }` blocks can get a bit long, so I thought it would make
sense to have an option that makes it so their contents are not indented
(basically the same argument as for namespaces).

This is based on the `NamespaceIndentation` option, except that there is
no option to control the behaviour of `export` blocks when nested because
nesting them doesn’t really make sense.

Additionally, brace wrapping of short `export { ... }` blocks is now controlled by the
`AllowShortBlocksOnASingleLine` option. There is no separate option just for `export`
blocks because you can just write e.g. `export int x;` instead of `export { int x; }`.

This closes #121723.

show more ...


# e2402615 18-Jan-2025 Ander <github32@anderg.fastmail.com>

[clang-format] Fix option `BreakBinaryOperations` for operator `>>` (#122282)

Fixes #106228.


# a7bca186 18-Jan-2025 Owen Pan <owenpiano@gmail.com>

[clang-format] Correctly annotate braces in macro definitions (#123279)

Fixes #123179.


Revision tags: llvmorg-19.1.7
# c1ea05ea 05-Jan-2025 Owen Pan <owenpiano@gmail.com>

[clang-format] Don't break short macro call followed by l_paren (#121626)

Fixes #105658.


# 1c997fef 03-Jan-2025 dmasloff <74042473+dmasloff@users.noreply.github.com>

[clang-format] Add option WrapNamespaceBodyWithNewlines (#106145)

It wraps the body of namespace with additional newlines, turning this code:
```
namespace N {
int function();
}
```
into the f

[clang-format] Add option WrapNamespaceBodyWithNewlines (#106145)

It wraps the body of namespace with additional newlines, turning this code:
```
namespace N {
int function();
}
```
into the following:
```
namespace N {

int function();

}
```

---------

Co-authored-by: Owen Pan <owenpiano@gmail.com>

show more ...


# 486ec4bd 30-Dec-2024 Galen Elias <gelias@gmail.com>

[clang-format] Add `AllowShortNamespacesOnASingleLine` option (#105597)

This fixes #101363 which is a resurrection of a previously opened but
never completed review: https://reviews.llvm.org/D11851

[clang-format] Add `AllowShortNamespacesOnASingleLine` option (#105597)

This fixes #101363 which is a resurrection of a previously opened but
never completed review: https://reviews.llvm.org/D11851

The feature is to allow code like the following not to be broken across
multiple lines:

```
namespace foo { class bar; }
namespace foo { namespace bar { class baz; } }
```

Code like this is commonly used for forward declarations, which are
ideally kept compact. This is also apparently the format that
include-what-you-use will insert for forward declarations.

Also, fix an off-by-one error in `CompactNamespaces` code. For nested
namespaces with 3 or more namespaces, it was incorrectly compacting
lines which were 1 or two spaces over the `ColumnLimit`, leading to
incorrect formatting results.

show more ...


# fe268530 19-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a crash caused by commit f03bf8c45f43


# f03bf8c4 18-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Don't change breaking before CtorInitializerColon (#119522)

Don't change breaking before CtorInitializerColon with `ColumnLimit: 0`.

Fixes #119519.


Revision tags: llvmorg-19.1.6
# 54ca1c42 11-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix idempotent format of hash in macro body (#118513)

Fixes #118334.


# 46bf67d8 10-Dec-2024 Gedare Bloom <gedare@rtems.org>

[clang-format] Reorder TokenAnnotator::canBreakBefore (#119044)

Move the checks related to breaking before right braces and right parens
earlier to avoid conflicting checks that prevent breaking ba

[clang-format] Reorder TokenAnnotator::canBreakBefore (#119044)

Move the checks related to breaking before right braces and right parens
earlier to avoid conflicting checks that prevent breaking based on the
left-hand token. This allows properly formatting declarations with
pointers and references at a minimum.

show more ...


# cb61a5e4 08-Dec-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix an assertion failure in RemoveSemicolon (#117472)

Fixes #117290.


Revision tags: llvmorg-19.1.5, llvmorg-19.1.4
# df232d46 02-Nov-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Don't re-annotate CaseLabelColon as ConditionalExpr (#114639)

Fixes #114627.


Revision tags: llvmorg-19.1.3
# 786db636 24-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Add KeepFormFeed option (#113268)

Closes #113170.


# d989c241 18-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Add RemoveEmptyLinesInUnwrappedLines option (#112325)

Fixes #111340.


Revision tags: llvmorg-19.1.2
# 0fba8381 12-Oct-2024 Iuri Chaer <ichaer@splunk.com>

[clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (#96804)

* Convert `ReflowComments` from boolean into a new `enum` wh

[clang-format] Introduce "ReflowComments: IndentOnly" to re-indent comments without breaking internal structure (think Doxygen). (#96804)

* Convert `ReflowComments` from boolean into a new `enum` which can take
on the value `RCS_Never`, `RCS_IndentOnly`, or `RCS_Always`. The first
one is equivalent to the old `false`, the third one is `true`, and the
middle one means that multiline comments should only have their
indentation corrected, which is what Doxygen users will want.
* Preserve backward compatibility while parsing `ReflowComments`.

show more ...


# 1809d0fa 09-Oct-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Insert a space between l_paren and ref-qualifier (#111465)

Fixes #111346.


# f0bd62d8 07-Oct-2024 Brad House <brad@brad-house.com>

[clang-format] Add AlignFunctionDeclarations to AlignConsecutiveDeclarations (#108241)

Enabling AlignConsecutiveDeclarations also aligns function prototypes
or declarations. This is often unexpect

[clang-format] Add AlignFunctionDeclarations to AlignConsecutiveDeclarations (#108241)

Enabling AlignConsecutiveDeclarations also aligns function prototypes
or declarations. This is often unexpected as typically function
prototypes, especially in public headers, don't use any padding.

Setting AlignFunctionDeclarations to false will skip this alignment.
It is by default set to true to keep compatibility with prior
versions to not make unexpected changes.

Fixes #74320

show more ...


Revision tags: llvmorg-19.1.1
# df935ff4 22-Sep-2024 Gedare Bloom <gedare@rtems.org>

[clang-format] Fix regression with BlockIndent of Braced Initializers (#108717)

Fixes #73584.


# a8dd8f63 18-Sep-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in SpacesInParens InConditionalStatements (#108797)

Fixes #64416.


# 7153a4bb 18-Sep-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Reimplement InsertNewlineAtEOF (#108513)

Fixes #108333.


Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4
# fac7e87d 28-Aug-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Insert a space between new/delete and a C-style cast (#106175)

It doesn't make sense to remove the space between new/delete and a
C-style cast when SpaceBeforeParensOptions.AfterPlac

[clang-format] Insert a space between new/delete and a C-style cast (#106175)

It doesn't make sense to remove the space between new/delete and a
C-style cast when SpaceBeforeParensOptions.AfterPlacementOperator is set
to false.

Fixes #105628.

show more ...


# 656d5aa9 28-Aug-2024 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix misalignments of pointers in angle brackets (#106013)

Fixes #105898.


12345678910>>...82