Skip to content

[clamg-format] Add BreakIfInitializer option #148741

@SunBlack

Description

@SunBlack

Since C++17 it is allowed to add a init-statement within an if condition.

It would therefore be nice if you could control whether this statement should be in an extra line or not.

So there should be 3 options:

  • Keep => Don't adjust the code
  • Always:
    if (const auto it = map.find(key);
        it != map.end())
    {
      ...
    }
  • Never:
    if (const auto it = map.find(key); it != map.end())
    {
      ...
    }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions