Skip to content
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

Lambdas as the last argument of a function are indented too much if the function has many parameters #40610

Open
bogner opened this issue Mar 27, 2019 · 0 comments
Labels
bugzilla Issues migrated from bugzilla clang-format

Comments

@bogner
Copy link
Contributor

bogner commented Mar 27, 2019

Bugzilla Link 41265
Version 8.0
OS All
CC @dwblaikie

Extended Description

The coding standards doc states to format lambdas like blocks as long as they're the last arg:

http://www.llvm.org/docs/CodingStandards.html#format-lambdas-like-blocks-of-code

However, clang-format only seems to do that if the opening brace of the lambda is on the same line as the start of the function call:

some_call_to_a_function_with_a_long_name(arg1, arg2, [](int x) {
int y = x * x;
return y;
});

vs

some_call_to_a_function_with_a_long_name(long_arg1, really_long_arg2,
[](int x) {
int y = x * x;
return y;
});

The latter should really be:

some_call_to_a_function_with_a_long_name(long_arg1, really_long_arg2,
[](int x) {
int y = x * x;
return y;
});

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang-format
Projects
None yet
Development

No branches or pull requests

1 participant