Menu

#448 Indentation of C++ initializer list broken when passing a lambda function

closed-fixed
None
2023-06-29
2017-07-03
David Frey
No

When passing a lambda function as an argument In a C++ initializer list, the indentation of the subsequent members is broken (they are not indented at all).

The correct

Test::Test() : member1(argument)
    , member2([this] {some_code(argument);})
    , member3(42)
    , member4("test")
{
}

is changed to

Test::Test() : member1(argument)
    , member2([this] {some_code(argument);})
, member3(42)
, member4("test")
{
}

This is a similar issue as 441, however the fix doesn't work for this case.

3 Attachments

Discussion

  • David Frey

    David Frey - 2017-07-03

    Sorry, wrong file.

     
  • fritzophrenic

    fritzophrenic - 2017-10-24

    Possibly similar to issue 266? Lambdas are somewhat new to C++ and seem to mess up indent in a few ways.

     

    Last edit: fritzophrenic 2017-10-24
  • André Simon

    André Simon - 2023-05-10
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2023-05-10

    Please test with recent beta versions (3.3)

     
  • André Simon

    André Simon - 2023-06-29
    • status: open-accepted --> closed-fixed
     
  • André Simon

    André Simon - 2023-06-29

    Fixed with new option --indent-lambda.

     

Log in to post a comment.

MongoDB Logo MongoDB