diff options
| author | Daniel Jasper <djasper@google.com> | 2014-08-27 11:53:26 +0000 |
|---|---|---|
| committer | Daniel Jasper <djasper@google.com> | 2014-08-27 11:53:26 +0000 |
| commit | 168c8aa6795e2ae2d1f7655192aa2b64dc9cc273 (patch) | |
| tree | b00af76fa02cb5878322eb44921a413887616f57 /clang/lib | |
| parent | 870d951bda8e5431ce3eafb51f5db9fe74b6c411 (diff) | |
| download | bcm5719-llvm-168c8aa6795e2ae2d1f7655192aa2b64dc9cc273.tar.gz bcm5719-llvm-168c8aa6795e2ae2d1f7655192aa2b64dc9cc273.zip | |
clang-format: Fix regression in formatting of braced initializers.
Before:
Node n{1, Node{1000}, //
2};
After:
Node n{1, Node{1000}, //
2};
llvm-svn: 216540
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index be4dc886008..ac95f72b60f 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -313,7 +313,9 @@ private: updateParameterCount(Left, CurrentToken); if (CurrentToken->isOneOf(tok::colon, tok::l_brace)) { FormatToken *Previous = CurrentToken->getPreviousNonComment(); - if (Previous->is(tok::identifier)) + if ((CurrentToken->is(tok::colon) || + Style.Language == FormatStyle::LK_Proto) && + Previous->is(tok::identifier)) Previous->Type = TT_SelectorName; if (CurrentToken->is(tok::colon)) Left->Type = TT_DictLiteral; |

