Index: lib/Format/FormatTokenLexer.cpp =================================================================== --- lib/Format/FormatTokenLexer.cpp +++ lib/Format/FormatTokenLexer.cpp @@ -525,10 +525,12 @@ } else if (FormatTok->Tok.is(tok::greatergreater)) { FormatTok->Tok.setKind(tok::greater); FormatTok->TokenText = FormatTok->TokenText.substr(0, 1); + Column += 1; 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 += 1; StateStack.push(LexerState::TOKEN_STASHED); } Index: test/Format/bitshift-operator-width.cpp =================================================================== --- /dev/null +++ test/Format/bitshift-operator-width.cpp @@ -0,0 +1,13 @@ +// RUN: grep -Ev "// *[A-Z-]+:" %s | clang-format -style=LLVM \ +// RUN: | FileCheck -strict-whitespace %s + +// CHECK: {{^int a = 1 << 2; /\* foo$}} +// CHECK: {{^ bar \*/$}} +int a = 1 << 2; /* foo + bar */ + +// CHECK: {{^int b = 256 >> 2; /\* foo$}} +// CHECK: {{^ bar \*/$}} +int b = 256 >> 2; /* foo + bar */ +