[PATCH] D52676: [clang-format] tweaked another case of lambda formatting

Oleg Smolsky via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 10 10:36:30 PDT 2018


oleg.smolsky added a comment.

@djasper @klimek could you chime in please? This patch strives to cleanup a quirk in lambda formatting which pushes code too far to the right. Here is the problematic case:

  void f() {
    something.something.something.Method(some_arg,
                                         [] {
                                             // the code here incurs
                                             // excessive wrapping
                                             // such as
                                             Method(
                                                 some_med_arg,
                                                 some_med_arg);
                                             some_var =
                                                 some_expr + something;
                                        });

Here everything is technically correct, yet the code looks bad due to excessive wrapping. Things look a lot better when the lambda body starts from a new line, which happens already in some cases. The patch this "from the next line" onto a few more cases.

The full discussion of the cases with @krasimir is above.

Thanks!


Repository:
  rC Clang

https://reviews.llvm.org/D52676





More information about the cfe-commits mailing list