================ @@ -228,8 +228,8 @@ void UseOverrideCheck::check(const MatchFinder::MatchResult &Result) { if (HasVirtual) { for (Token Tok : Tokens) { if (Tok.is(tok::kw_virtual)) { - Diag << FixItHint::CreateRemoval(CharSourceRange::getTokenRange( - Tok.getLocation(), Tok.getLocation())); + Diag << FixItHint::CreateRemoval(CharSourceRange::getCharRange( + Tok.getLocation(), Tok.getEndLoc().getLocWithOffset(1))); ---------------- PiotrZSL wrote:
Won't work if there are two spaces. You should use LexerUtils::findNextTokenIncludingComments, and then take location -1 https://github.com/llvm/llvm-project/pull/81435 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits