diff options
author | Krasimir Georgiev <krasimir@google.com> | 2017-06-27 13:43:07 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2017-06-27 13:43:07 +0000 |
commit | ff747be4d50cb70f7d13e09f38ab093cdddeef95 (patch) | |
tree | f086e6bf2ef5ec68162ac7384d53d0a3ea9b218b /clang/lib/Format/FormatToken.h | |
parent | 4155c8f1f358d873f67afcc6240f4adb67011bfd (diff) | |
download | bcm5719-llvm-ff747be4d50cb70f7d13e09f38ab093cdddeef95.tar.gz bcm5719-llvm-ff747be4d50cb70f7d13e09f38ab093cdddeef95.zip |
[clang-format] Support <>-style proto message fields
Summary:
This patch adds support for <>-style proto message fields inside proto options.
Previously these were wrongly treated as binary operators and as such were
working only by chance for a limited number of cases.
Reviewers: djasper
Reviewed By: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D34621
llvm-svn: 306406
Diffstat (limited to 'clang/lib/Format/FormatToken.h')
-rw-r--r-- | clang/lib/Format/FormatToken.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index c5bf48cdcc0..ddec578f89a 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -465,7 +465,8 @@ struct FormatToken { return is(TT_ArrayInitializerLSquare) || (is(tok::l_brace) && (BlockKind == BK_Block || is(TT_DictLiteral) || - (!Style.Cpp11BracedListStyle && NestingLevel == 0))); + (!Style.Cpp11BracedListStyle && NestingLevel == 0))) || + (is(tok::less) && Style.Language == FormatStyle::LK_Proto); } /// \brief Same as opensBlockOrBlockTypeList, but for the closing token. |