Skip to content

clang-format adds bogus linebreak when function arguments contain lambda #44486

Closed
@realnc

Description

@realnc
Bugzilla Link 45141
Version 10.0
OS Linux
CC @mkurdej,@emmenlau

Extended Description

clang-format is unable to correctly format code like this:

func(0, [] {}, 0);

It will format it into:

func(
    0, [] {}, 0);

Shortest example code that reproduces it:

void f()
{
    func(0, [] {}, 0);
}

The clang-format invocation can be the simplest possible. Just "clang-format test.cpp" without any .clang-format input file and no arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions