[clang-tools-extra] [clang-tidy] Add modernize-use-shared-ptr-array check (#180441) (PR #199458)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 25 21:55:16 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 3248 tests passed
* 7 tests skipped
* 2 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang Tools
<details>
<summary>Clang Tools.clang-tidy/infrastructure/alphabetical-order.test</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.clang-tidy-checks-list.rst
# executed command: /usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.clang-tidy-checks-list.rst
# note: command had no output on stdout or stderr
# RUN: at line 2
diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/clang-tidy/checks/list.rst /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.clang-tidy-checks-list.rst
# executed command: diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/clang-tidy/checks/list.rst /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.clang-tidy-checks-list.rst
# note: command had no output on stdout or stderr
# RUN: at line 4
/usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.ReleaseNotes.rst
# executed command: /usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.ReleaseNotes.rst
# .---command stderr------------
# | 
# | Entries in 'clang-tools-extra/docs/ReleaseNotes.rst' are not alphabetically sorted.
# | Fix the ordering by applying diff printed below.
# | 
# `-----------------------------
# RUN: at line 5
diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/ReleaseNotes.rst /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.ReleaseNotes.rst
# executed command: diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/ReleaseNotes.rst /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.ReleaseNotes.rst
# .---command stdout------------
# | *** /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/ReleaseNotes.rst
# | --- /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/alphabetical-order.test.tmp.ReleaseNotes.rst
# | ***************
# | *** 257,274 ****
# |   
# |     Finds cyclical initialization of static variables.
# |   
# | - - New :doc:`modernize-use-std-bit
# | -   <clang-tidy/checks/modernize/use-std-bit>` check.
# | - 
# | -   Finds common idioms which can be replaced by standard functions from the
# | -   ``<bit>`` C++20 header.
# | - 
# |   - New :doc:`modernize-use-shared-ptr-array
# |     <clang-tidy/checks/modernize/use-shared-ptr-array>` check.
# |   
# |     Finds ``std::shared_ptr<T>`` constructions managing arrays via explicit
# |     array deleters and replaces them with ``std::shared_ptr<T[]>``.
# |     
# |   - New :doc:`modernize-use-string-view
# |     <clang-tidy/checks/modernize/use-string-view>` check.
# |   
# | --- 257,274 ----
# |   
# |     Finds cyclical initialization of static variables.
# |   
# |   - New :doc:`modernize-use-shared-ptr-array
# |     <clang-tidy/checks/modernize/use-shared-ptr-array>` check.
# |   
# |     Finds ``std::shared_ptr<T>`` constructions managing arrays via explicit
# |     array deleters and replaces them with ``std::shared_ptr<T[]>``.
# |     
# | + - New :doc:`modernize-use-std-bit
# | +   <clang-tidy/checks/modernize/use-std-bit>` check.
# | + 
# | +   Finds common idioms which can be replaced by standard functions from the
# | +   ``<bit>`` C++20 header.
# | + 
# |   - New :doc:`modernize-use-string-view
# |     <clang-tidy/checks/modernize/use-string-view>` check.
# |   
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>
<details>
<summary>Clang Tools.clang-tidy/infrastructure/update-checks-list.test</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
/usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../clang-tidy/tool/check_update_docs.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/update-checks-list.test.tmp.clang-tidy-checks-list.rst
# executed command: /usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../clang-tidy/tool/check_update_docs.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/update-checks-list.test.tmp.clang-tidy-checks-list.rst
# .---command stderr------------
# | 
# | 'clang-tools-extra/docs/clang-tidy/checks/list.rst' is out of date.
# | Fix it by running 'clang-tools-extra/clang-tidy/add_new_check.py --update-docs'.
# | 
# `-----------------------------
# RUN: at line 2
diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/clang-tidy/checks/list.rst /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/update-checks-list.test.tmp.clang-tidy-checks-list.rst
# executed command: diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/clang-tidy/checks/list.rst /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/update-checks-list.test.tmp.clang-tidy-checks-list.rst
# .---command stdout------------
# | *** /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/test/clang-tidy/infrastructure/../../../docs/clang-tidy/checks/list.rst
# | --- /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/tools/extra/test/clang-tidy/infrastructure/Output/update-checks-list.test.tmp.clang-tidy-checks-list.rst
# | ***************
# | *** 326,331 ****
# | --- 326,332 ----
# |      :doc:`modernize-use-override <modernize/use-override>`, "Yes"
# |      :doc:`modernize-use-ranges <modernize/use-ranges>`, "Yes"
# |      :doc:`modernize-use-scoped-lock <modernize/use-scoped-lock>`, "Yes"
# | +    :doc:`modernize-use-shared-ptr-array <modernize/use-shared-ptr-array>`, "Yes"
# |      :doc:`modernize-use-starts-ends-with <modernize/use-starts-ends-with>`, "Yes"
# |      :doc:`modernize-use-std-bit <modernize/use-std-bit>`, "Yes"
# |      :doc:`modernize-use-std-format <modernize/use-std-format>`, "Yes"
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

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


More information about the cfe-commits mailing list