[clang-tools-extra] [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (PR #108555)
Julian Schmidt via cfe-commits
cfe-commits at lists.llvm.org
Sun Sep 15 15:13:22 PDT 2024
================
@@ -112,8 +112,9 @@ Changes in existing checks
the offending code with ``reinterpret_cast``, to more clearly express intent.
- Improved :doc:`modernize-avoid-c-arrays
- <clang-tidy/checks/modernize/avoid-c-arrays>` check to suggest use std::span
- as replacement of c array in C++20.
+ <clang-tidy/checks/modernize/avoid-c-arrays>` check to suggest using
+ ``std::span`` as replacement of incomplete C array in C++20 and ``std::vector``
+ in the versions before C++20.
----------------
5chmidti wrote:
What do you think about
> to suggest using ``std::span`` as a replacement for parameters of incomplete C array type in C++20 and ``std::array`` or ``std::vector`` before C++20.
https://github.com/llvm/llvm-project/pull/108555
More information about the cfe-commits
mailing list