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

Helmut Januschka via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 18 08:16:50 PST 2026


================
@@ -0,0 +1,23 @@
+.. title:: clang-tidy - readability-use-span-first-last
+
+readability-use-span-first-last
+===============================
+
+Checks for uses of ``std::span::subspan()`` that can be replaced with clearer
+``first()`` or ``last()`` member functions. These dedicated methods were added 
+to C++20 to provide more expressive alternatives to common subspan operations.
+
+Covered scenarios:
+
+==================================== ==================================
----------------
hjanuschka wrote:

Done.

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


More information about the cfe-commits mailing list