diff options
author | Malcolm Parsons <malcolm.parsons@gmail.com> | 2016-11-03 16:57:30 +0000 |
---|---|---|
committer | Malcolm Parsons <malcolm.parsons@gmail.com> | 2016-11-03 16:57:30 +0000 |
commit | 6af3f14efb0ad169eb5239ca1a9b7027925aadd2 (patch) | |
tree | 31b0c3b08d56cafde7f58614fcc563587c0531b9 /clang/lib/Format/FormatTokenLexer.cpp | |
parent | 6dcf4c6859f8c4dd060a3b3c1bc3c34c214b0d36 (diff) | |
download | bcm5719-llvm-6af3f14efb0ad169eb5239ca1a9b7027925aadd2.tar.gz bcm5719-llvm-6af3f14efb0ad169eb5239ca1a9b7027925aadd2.zip |
Fixed column shift when formatting line containing bit shift operators
Summary:
During clang-format source lexing >> and << operators are split and
treated as two less/greater operators but column position of following
tokens was not adjusted accordingly.
Fixes PR26887
Patch by Paweł Żukowski.
Reviewers: djasper
Subscribers: malcolm.parsons, mprobst, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D25439
llvm-svn: 285934
Diffstat (limited to 'clang/lib/Format/FormatTokenLexer.cpp')
-rw-r--r-- | clang/lib/Format/FormatTokenLexer.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/FormatTokenLexer.cpp b/clang/lib/Format/FormatTokenLexer.cpp index c9670aeff66..2aa48e3f491 100644 --- a/clang/lib/Format/FormatTokenLexer.cpp +++ b/clang/lib/Format/FormatTokenLexer.cpp @@ -525,10 +525,12 @@ FormatToken *FormatTokenLexer::getNextToken() { } else if (FormatTok->Tok.is(tok::greatergreater)) { FormatTok->Tok.setKind(tok::greater); FormatTok->TokenText = FormatTok->TokenText.substr(0, 1); + ++Column; StateStack.push(LexerState::TOKEN_STASHED); } else if (FormatTok->Tok.is(tok::lessless)) { FormatTok->Tok.setKind(tok::less); FormatTok->TokenText = FormatTok->TokenText.substr(0, 1); + ++Column; StateStack.push(LexerState::TOKEN_STASHED); } |