[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:21 PDT 2024


================
@@ -10,6 +10,9 @@ modernize-avoid-c-arrays
 Finds C-style array types and recommend to use ``std::array<>`` /
 ``std::vector<>``. All types of C arrays are diagnosed.
 
+For incomplete C-style array types appeared in parameters, It would be better to
+use ``std::span`` / ``gsl::span`` as replacement.
+
----------------
5chmidti wrote:

`appearing in parameters, it`
or even better IMO:
`For parameters of incomplete C-style array type, it would`

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


More information about the cfe-commits mailing list