Skip to content

BraceWrapping: BeforeLambdaBody: true not working under some circumstances #59724

@tinachen123

Description

@tinachen123

I have the following clang-format configurations:

---
Language:        Cpp
BasedOnStyle:    Google
BreakBeforeBraces: Allman
ColumnLimit:     100
IndentWidth: 4

And clang format won't format this code block to break before the brace before the lambda body:

void Func()
{
    []() {
        return TestVeryLongThingName::TestVeryLongFunctionName()
            .TestAnotherVeryVeryLongFunctionName();
    }
}

However, it works for this block (if I made the continuation longer)

void Func()
{
    []()
    {
        return TestVeryLongThingName::TestVeryLongFunctionName()
            .TestAnotherVeryVeryVeryLongFunctionName();
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions