================
@@ -447,7 +447,7 @@ class HighlightingsBuilder {
     if (!RLoc.isValid())
       return;
 
-    const auto *RTok = TB.spelledTokenAt(RLoc);
+    const auto *RTok = TB.spelledTokenContaining(RLoc);
----------------
kadircet wrote:

so looks like this call site was actually expecting it to be null when provided 
with an offset into the token, but that's OK overall, as it's also trying to 
just slice the token.

can you update the surroundings to reflect the new behavior so we don't leave 
old state documented for future travelers? something like:
```

// RLoc is either part of `>>` or a spelled token on its own `>`.
// If it's the former, slice to have length of 1, if latter use the token as-is.
assert(RTok);
if (RTok->kind() == ...) 
```

https://github.com/llvm/llvm-project/pull/94528
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to