[clang] [clang-tools-extra] [clang][refactor] Refactor `findNextTokenIncludingComments` (PR #123060)

Clement Courbet via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 17 01:32:40 PST 2025


legrosbuffle wrote:

> `Lexer::findNextToken` has an additional check:
> 
> `if (!Lexer::isAtEndOfMacroExpansion(Loc, SM, LangOpts, &Loc))`
> 
> Does this not change behavior in the case we are replacing? I imagine folks just copied from `Lexer::findNextToken` and purposely left this out, is that wrong?

I think the intent was clearly to copy the whole thing, the original author states: "This part of code copy from Lexer::findNextToken except this line. " [source](https://reviews.llvm.org/D147194?id=509531) "this line" referring to `L.SetCommentRetentionState(WithComment);`.



https://github.com/llvm/llvm-project/pull/123060


More information about the cfe-commits mailing list