Skip to content

Clang-format - AllowShortLambdasOnASingleLine - doesn't work for braced called constructers #125430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
robert-andrzejuk opened this issue Feb 2, 2025 · 1 comment · Fixed by #135520
Assignees

Comments

@robert-andrzejuk
Copy link

Set: AllowShortLambdasOnASingleLine : Inline

Example (brace):

      auto guard = scope_exit{[&]{exit_status = true;}};

formats to:

      auto guard = scope_exit{ [&]
                               {
                                   exit_status = true;
                                } };

Should be:

      auto guard = scope_exit{[&] { exit_status = true; }};

This works correctly with parenthesis constructor parameters.

@llvmbot
Copy link
Member

llvmbot commented Feb 2, 2025

@llvm/issue-subscribers-clang-format

Author: Robert Andrzejuk (robert-andrzejuk)

Set: AllowShortLambdasOnASingleLine : Inline

Example (brace):

      auto guard = scope_exit{[&]{exit_status = true;}};

formats to:

      auto guard = scope_exit{ [&]
                               {
                                   exit_status = true;
                                } };

Should be:

      auto guard = scope_exit{[&] { exit_status = true; }};

This works correctly with parenthesis constructor parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants