HomePhabricator

clang-format: remove trailing lines in lamdas and arrow functions.

Description

clang-format: remove trailing lines in lamdas and arrow functions.

Summary:
clang-format already removes empty lines at the beginning & end of
blocks:

int x() {

  foo();  // lines before and after will be removed.

}

However because lamdas and arrow functions are parsed as expressions,
the existing logic to remove empty lines in UnwrappedLineFormatter
doesn't handle them.

This change special cases arrow functions in ContinuationIndenter to
remove empty lines:

x = []() {

  foo();  // lines before and after will now be removed.

};

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D40178

Details

Committed
mprobstNov 17 2017, 10:06 AM
Differential Revision
D40178: clang-format: [JS] remove trailing lines in arrow functions.
Parents
rC318536: [OPENMP] Codegen for `target simd` construct.
Branches
Unknown
Tags
Unknown