[clang-tools-extra] [clang-tidy] Add readability-use-span-first-last check (PR #118074)

Julian Schmidt via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 30 03:11:09 PST 2024


https://github.com/5chmidti requested changes to this pull request.

It would be great to have this check work with uninstantiated templates and use `TK_TraversUnlessSpelledInSource` as well.

Here is an example of a matcher for the uninstantiated case: 
https://godbolt.org/z/1xnGGj7z9

I couldn't fully write it, because there is no matcher to get the member information and constrain it to `subspan`.

--

Please also adjust your PR comment to reflect the change for what pattern is matched in the `last` case.

---

Overall a good readability improvement check, nice

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


More information about the cfe-commits mailing list