diff options
author | Daniel Jasper <djasper@google.com> | 2015-06-12 09:59:16 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-06-12 09:59:16 +0000 |
commit | 60ba32d453464d6e5c7875d0be892a1389931ff8 (patch) | |
tree | dcd97e114f2e08635eddf3e6828c2241b5fd3c6f /clang/lib | |
parent | d9e39d53b6ebe528d0c5728a9dd95e227856bfee (diff) | |
download | bcm5719-llvm-60ba32d453464d6e5c7875d0be892a1389931ff8.tar.gz bcm5719-llvm-60ba32d453464d6e5c7875d0be892a1389931ff8.zip |
clang-format: Always add space before lambda-{
Before:
int c = []() -> int *{ return 2; }();
After:
int c = []() -> int * { return 2; }();
Based on patch by James Dennett (http://reviews.llvm.org/D10410), thank you!
llvm-svn: 239600
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 3e8659ef853..8ffd67f0d11 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1800,6 +1800,7 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line, return true; if (Left.is(TT_PointerOrReference)) return Right.Tok.isLiteral() || Right.is(TT_BlockComment) || + (Right.is(tok::l_brace) && Right.BlockKind == BK_Block) || (!Right.isOneOf(TT_PointerOrReference, TT_ArraySubscriptLSquare, tok::l_paren) && (Style.PointerAlignment != FormatStyle::PAS_Right && |