llvm-project/clang/unittests/Format
mydeveloperday eae445f65d [clang-format] PR50326 AlignAfterOpenBracket AlwaysBreak does not keep to the ColumnLimit
https://bugs.llvm.org/show_bug.cgi?id=50326

{D93626} caused a regression in terms of formatting a function ptr, incorrectly thinking it was a C-Style cast.

This cased a formatter regression between clang-format-11 and clang-format-12

```
void bar()
{
    size_t foo = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

    size_t foo = function(
        Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
        FoooooooooLooooong);

    size_t foo = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

    size_t foo = (*(
        function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong,
        BarrrrrrrrrrrrLong, FoooooooooLooooong);
}
```

became

```
void bar()
{
    size_t foo1 = function(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong);

    size_t foo2 = function(
        Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong,
        FoooooooooLooooong);

    size_t foo3 = (*(function))(Foooo, Barrrrr, Foooo, FoooooooooLooooong);

    size_t foo4 = (*(
        function))(Foooo, Barrrrr, Foooo, Barrrr, FoooooooooLooooong, BarrrrrrrrrrrrLong, FoooooooooLooooong);
}
```

This fixes this issue by simplify the clause to be specific about what is wanted rather than what is not.

Reviewed By: curdeius, HazardyKnusperkeks

Differential Revision: https://reviews.llvm.org/D102392
2021-05-15 11:29:56 +01:00
..
CMakeLists.txt [clang-format] Fix misformatted macro definitions after D86959 2020-10-27 12:16:46 +00:00
CleanupTest.cpp [clang-format] Drop clangFrontend dependency for FormatTests 2020-10-20 10:13:28 +01:00
FormatTest.cpp [clang-format] PR50326 AlignAfterOpenBracket AlwaysBreak does not keep to the ColumnLimit 2021-05-15 11:29:56 +01:00
FormatTestCSharp.cpp [clang-format] Fix C# nullable-related errors 2021-05-06 12:11:15 +02:00
FormatTestComments.cpp [clang-format] Respect spaces in line comment section... 2021-03-01 21:28:14 +01:00
FormatTestJS.cpp clang-format: [JS] do not wrap after `asserts` 2021-04-21 16:33:55 +02:00
FormatTestJava.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestObjC.cpp Bump googletest to 1.8.1 2021-05-14 17:20:06 +02:00
FormatTestProto.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestRawStrings.cpp clang-format: use `pb` as a canonical raw string delimiter for google style 2021-03-09 09:07:14 +01:00
FormatTestSelective.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00
FormatTestTableGen.cpp [clang-format][TableGen] Don't add spaces around items in square braces. 2019-03-01 00:12:18 +00:00
FormatTestTextProto.cpp [clang-format] Fix handling of TextProto comments 2020-12-23 22:07:13 +01:00
FormatTestUtils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MacroExpanderTest.cpp [clang-format] [NFC] keep clang-format tests clang-format clean 2020-12-05 10:15:52 +00:00
NamespaceEndCommentsFixerTest.cpp [clang-format][PR47290] Add ShortNamespaceLines format option 2021-03-01 21:28:14 +01:00
SortImportsTestJS.cpp clang-format: [JS] handle "off" in imports 2021-04-30 14:18:52 +02:00
SortImportsTestJava.cpp [clang-format] Add case aware include sorting. 2021-02-02 15:12:27 +01:00
SortIncludesTest.cpp [Format] Don't sort includes if DisableFormat is true 2021-05-04 19:04:12 +01:00
TestLexer.h Fix use-after-scope introduced in 850325348a 2020-10-27 14:26:23 +00:00
TokenAnnotatorTest.cpp Fix use-after-scope introduced in 850325348a 2020-10-27 14:26:23 +00:00
UsingDeclarationsSorterTest.cpp [clang-format] NFC - clang-format the FormatTests 2020-05-02 15:42:20 +01:00