https://bugs.llvm.org/show_bug.cgi?id=41265

            Bug ID: 41265
           Summary: Lambdas as the last argument of a function are
                    indented too much if the function has many parameters
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

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;
  });

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to