History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 276 – 300 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-14.0.5
# 40a5d79a 09-Jun-2022 owenca <owenpiano@gmail.com>

[clang-format][NFC] Format lib/Format and unittests/Format in clang

Reformat these directories with InsertBraces and RemoveBracesLLVM.

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


# 5ead1f13 06-Jun-2022 owenca <owenpiano@gmail.com>

[clang-format] Remove braces of else blocks that embody an if block

Fixes #55663.

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


# fc1c160f 04-Jun-2022 owenca <owenpiano@gmail.com>

[clang-format] Handle attributes for for/while loops

Fixes #55853.

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


# db15e312 01-Jun-2022 owenca <owenpiano@gmail.com>

[clang-format] Handle do-while loops for RemoveBracesLLVM

Also updates the unit tests to match the updated LLVM Coding
Standards.

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


# 5221875a 26-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Fix an invalid code generation in RemoveBracesLLVM

Fixes #55706.

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


# 8f70d16c 26-May-2022 Tyler Chatow <tchatow@gmail.com>

[clang-format] Handle attributes in enum declaration.

Fixes https://github.com/llvm/llvm-project/issues/55457

Ensures that attributes in the enum declaration are interpreted
correctly, for instance

[clang-format] Handle attributes in enum declaration.

Fixes https://github.com/llvm/llvm-project/issues/55457

Ensures that attributes in the enum declaration are interpreted
correctly, for instance:

```
enum class [[nodiscard]] E {
a,
b
};
```

Reviewed By: MyDeveloperDay, curdeius

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

show more ...


Revision tags: llvmorg-14.0.4
# 554efc22 21-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Format unit tests with InsertBraces/RemoveBracesLLVM


# 130a9cc0 21-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Fix a crash on lambda trailing return type

Fixes #55625.


# f4d52cad 21-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Fix a bug in "AfterControlStatement: MultiLine"

Fixes #55582.

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


# 1443dbab 16-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Handle "complex" conditionals in RemoveBracesLLVM

Do not remove braces if the conditional of if/for/while might not
fit on a single line even after the opening brace is removed.

Exam

[clang-format] Handle "complex" conditionals in RemoveBracesLLVM

Do not remove braces if the conditional of if/for/while might not
fit on a single line even after the opening brace is removed.

Examples:
// ColumnLimit: 20
// 45678901234567890
if (a) { /* Remove. */
foo();
}
if (-b >= c) { // Keep.
bar();
}

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

show more ...


# 749fb33e 20-May-2022 Tobias Hieta <tobias.hieta@ubisoft.com>

[clang-format] Don't break lines after pragma region

We have autogenerated pragma regions in our code
which where awkwardly broken up like this:

```
#pragma region foo(bar : hello)
```
becomes

```

[clang-format] Don't break lines after pragma region

We have autogenerated pragma regions in our code
which where awkwardly broken up like this:

```
#pragma region foo(bar : hello)
```
becomes

```
#pragma region foo(bar \
: hello)
```

This fixes the problem by adding region as a keyword
and handling it the same way as pragma mark

Reviewed By: curdeius

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

show more ...


# 573a5b58 18-May-2022 Marek Kurdej <marek.kurdej+llvm.org@gmail.com>

Revert "[clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline."

This reverts commit 50cd52d9357224cce66a9e00c9a0417c658a5655.

It pr

Revert "[clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline."

This reverts commit 50cd52d9357224cce66a9e00c9a0417c658a5655.

It provoked regressions in C++ and ObjectiveC as described in https://reviews.llvm.org/D123676#3515949.

Reproducers:
```
MACRO_BEGIN
#if A
int f();
#else
int f();
#endif
```

```
NS_SWIFT_NAME(A)
@interface B : C
@property(readonly) D value;
@end
```

show more ...


# e57f5784 16-May-2022 Gregory Fong <gregory.0xf0@gmail.com>

[clang-format] fix alignment w/o binpacked args

The combination of

- AlignConsecutiveAssignments.Enabled = true
- BinPackArguments = false

would result in the first continuation line of a braced-i

[clang-format] fix alignment w/o binpacked args

The combination of

- AlignConsecutiveAssignments.Enabled = true
- BinPackArguments = false

would result in the first continuation line of a braced-init-list being
improperly indented (missing a shift) when in a continued function call.
Indentation was also wrong for braced-init-lists continuing a
direct-list-initialization. Check for opening braced lists in
continuation and ensure that the correct shift occurs.

Fixes https://github.com/llvm/llvm-project/issues/55360

Reviewed By: curdeius

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

show more ...


# e20bc892 13-May-2022 Marek Kurdej <marek.kurdej+llvm.org@gmail.com>

[clang-format] Fix PointerAlignment: Right not working with tab indentation.

Fixes https://github.com/llvm/llvm-project/issues/55407.

Given configuration:
```
UseTab: Always
PointerAlignment: Right

[clang-format] Fix PointerAlignment: Right not working with tab indentation.

Fixes https://github.com/llvm/llvm-project/issues/55407.

Given configuration:
```
UseTab: Always
PointerAlignment: Right
AlignConsecutiveDeclarations: true
```

Before, the pointer was misaligned in this code:
```
void f() {
unsigned long long big;
char *ptr; // misaligned
int i;
}
```

That was due to the fact that when handling right-aligned pointers, the Spaces were changed but StartOfTokenColumn was not.

Also, a tab was used not only for indentation but for spacing too when using `UseTab: ForIndentation` config option:
```
void f() {
unsigned long long big;
char *ptr; // \t after char
int i;
}
```

Reviewed By: owenpan

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

show more ...


# 2cdabc03 13-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Handle "if consteval { ... }" for RemoveBracesLLVM

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


# 6cd9633c 12-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Handle comments below r_brace in RemoveBracesLLVM

If a closing brace is followed by a non-trailing comment, the
newline before the closing brace must also be removed.

Differential Re

[clang-format] Handle comments below r_brace in RemoveBracesLLVM

If a closing brace is followed by a non-trailing comment, the
newline before the closing brace must also be removed.

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

show more ...


# b6d8c84f 06-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Don't remove braces if a 1-statement body would wrap

Reimplement the RemoveBracesLLVM feature which handles a
single-statement block that would get wrapped.

Fixes #53543.

Differenti

[clang-format] Don't remove braces if a 1-statement body would wrap

Reimplement the RemoveBracesLLVM feature which handles a
single-statement block that would get wrapped.

Fixes #53543.

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

show more ...


# dab5e10e 11-May-2022 Sergey Semushin <predelnik@gmail.com>

[clang-format] fix nested angle brackets parse inside concept definition

Due to how parseBracedList always stopped on the first closing angle
bracket and was used in parsing angle bracketed expressi

[clang-format] fix nested angle brackets parse inside concept definition

Due to how parseBracedList always stopped on the first closing angle
bracket and was used in parsing angle bracketed expression inside concept
definition, nested brackets inside concepts were parsed incorrectly.

nextToken() call before calling parseBracedList is required because
we were processing opening angle bracket inside parseBracedList second
time leading to incorrect logic after my fix.

Fixes https://github.com/llvm/llvm-project/issues/54943
Fixes https://github.com/llvm/llvm-project/issues/54837

Reviewed By: HazardyKnusperkeks, curdeius

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

show more ...


# 85ec8a9a 06-May-2022 Marek Kurdej <marek.kurdej+llvm.org@gmail.com>

[clang-format] Correctly handle SpaceBeforeParens for builtins.

That's a partial fix for https://github.com/llvm/llvm-project/issues/55292.

Before, known builtins behaved differently from other ide

[clang-format] Correctly handle SpaceBeforeParens for builtins.

That's a partial fix for https://github.com/llvm/llvm-project/issues/55292.

Before, known builtins behaved differently from other identifiers:
```
void f () { return F (__builtin_LINE() + __builtin_FOO ()); }
```
After:
```
void f () { return F (__builtin_LINE () + __builtin_FOO ()); }
```

Reviewed By: owenpan

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

show more ...


Revision tags: llvmorg-14.0.3, llvmorg-14.0.2
# 50cd52d9 13-Apr-2022 Marek Kurdej <marek.kurdej+llvm.org@gmail.com>

[clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline.

Fixes https://github.com/llvm/llvm-project/issues/54522.

This fixes regressi

[clang-format] Fix WhitespaceSensitiveMacros not being honoured when macro closing parenthesis is followed by a newline.

Fixes https://github.com/llvm/llvm-project/issues/54522.

This fixes regression introduced in https://github.com/llvm/llvm-project/commit/5e5efd8a91f2e340e79a73bedbc6ab66ad4a4281.

Before the culprit commit, macros in WhitespaceSensitiveMacros were correctly formatted even if their closing parenthesis weren't followed by semicolon (or, to be precise, when they were followed by a newline).
That commit changed the type of the macro token type from TT_UntouchableMacroFunc to TT_FunctionLikeOrFreestandingMacro.

Correct formatting (with `WhitespaceSensitiveMacros = ['FOO']`):
```
FOO(1+2)
FOO(1+2);
```

Regressed formatting:
```
FOO(1 + 2)
FOO(1+2);
```

Reviewed By: HazardyKnusperkeks, owenpan, ksyx

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

show more ...


# e7aed737 05-May-2022 owenca <owenpiano@gmail.com>

[clang-format][NFC] Add a few regression tests


# 8b626a2c 04-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Fix another bug in AlignConsecutiveAssignments

The ShouldShiftBeAdded lambda checks if extra space should be
added before the wrapped part of a braced list. If the first
element of th

[clang-format] Fix another bug in AlignConsecutiveAssignments

The ShouldShiftBeAdded lambda checks if extra space should be
added before the wrapped part of a braced list. If the first
element of the list is wrapped, no extra space should be added.

Fixes #55161.

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

show more ...


# 342e1c77 03-May-2022 owenca <owenpiano@gmail.com>

[clang-format] Fix a bug in AlignConsecutiveAssignments

Fixes #55113.

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


# c819dce2 03-May-2022 Marek Kurdej <marek.kurdej+llvm.org@gmail.com>

[clang-format] Add a regression test for aligning macros with keywords.

Test from issue https://github.com/llvm/llvm-project/issues/54953.


# c8603db0 28-Apr-2022 owenca <owenpiano@gmail.com>

[clang-format] Fix a bug that misformats Access Specifier after *[]

Fixes #55132.

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


1...<<11121314151617181920>>...82