[all-commits] [llvm/llvm-project] 785624: [clang-tidy]suggest use `std::span` as replacement...

Congcong Cai via All-commits all-commits at lists.llvm.org
Tue Sep 17 17:03:27 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 785624b28237bb75d4fa3b8e4219a5448b90eaac
      https://github.com/llvm/llvm-project/commit/785624b28237bb75d4fa3b8e4219a5448b90eaac
  Author: Congcong Cai <congcongcai0907 at 163.com>
  Date:   2024-09-18 (Wed, 18 Sep 2024)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/AvoidCArraysCheck.cpp
    M clang-tools-extra/docs/ReleaseNotes.rst
    M clang-tools-extra/docs/clang-tidy/checks/modernize/avoid-c-arrays.rst
    A clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-c++20.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-main.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-strings.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays-ignores-three-arg-main.cpp
    M clang-tools-extra/test/clang-tidy/checkers/modernize/avoid-c-arrays.cpp

  Log Message:
  -----------
  [clang-tidy]suggest use `std::span` as replacement of c array in C++20 for modernize-avoid-c-arrays (#108555)

The incompleted C-Array in parameter does not own memory. Instead, It is
equivalent to pointer.
So we should not use `std::array` as recommended modern C++ replacement,
but use `std::vector` and `std::span` in C++20



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list