diff --git a/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp b/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp index 4082a1cf8385cd..ef07ab06760b3d 100644 --- a/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp +++ b/clang/lib/Format/IntegerLiteralSeparatorFixer.cpp @@ -78,10 +78,9 @@ IntegerLiteralSeparatorFixer::process(const Environment &Env, Lex.SetCommentRetentionState(true); Token Tok; - Lex.LexFromRawLexer(Tok); - tooling::Replacements Result; - for (bool Skip = false; Tok.isNot(tok::eof); Lex.LexFromRawLexer(Tok)) { + + for (bool Skip = false; !Lex.LexFromRawLexer(Tok);) { auto Length = Tok.getLength(); if (Length < 2) continue;