[clang-tools-extra] [clang-tidy] Add `modernize-use-bit-cast` check (PR #189962)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 1 07:09:15 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 3112 tests passed
* 30 tests skipped
* 1 test 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
C:/Python312/python.exe C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py -o C:\_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: C:/Python312/python.exe 'C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py' -o 'C:\_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 C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../docs/clang-tidy/checks/list.rst C:\_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 'C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../docs/clang-tidy/checks/list.rst' 'C:\_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
C:/Python312/python.exe C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py -o C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\infrastructure\Output\alphabetical-order.test.tmp.ReleaseNotes.rst
# executed command: C:/Python312/python.exe 'C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../clang-tidy/tool/check_alphabetical_order.py' -o 'C:\_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 C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../docs/ReleaseNotes.rst C:\_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 'C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../docs/ReleaseNotes.rst' 'C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\infrastructure\Output\alphabetical-order.test.tmp.ReleaseNotes.rst'
# .---command stdout------------
# | *** C:\_work\llvm-project\llvm-project\clang-tools-extra\test\clang-tidy\infrastructure/../../../docs/ReleaseNotes.rst
# | --- C:\_work\llvm-project\llvm-project\build\tools\clang\tools\extra\test\clang-tidy\infrastructure\Output\alphabetical-order.test.tmp.ReleaseNotes.rst
# | ***************
# | *** 133,149 ****
# | ``llvm::to_vector(llvm::make_filter_range(...))`` that can be replaced with
# | ``llvm::map_to_vector`` and ``llvm::filter_to_vector``.
# |
# | - 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-bit-cast
# | - <clang-tidy/checks/modernize/use-bit-cast>` check.
# | -
# | - Finds conservative object-to-object ``memcpy`` type punning that can be
# | - rewritten as ``std::bit_cast`` in C++20 and later.
# |
# | - New :doc:`modernize-use-string-view
# | <clang-tidy/checks/modernize/use-string-view>` check.
# | --- 133,149 ----
# | ``llvm::to_vector(llvm::make_filter_range(...))`` that can be replaced with
# | ``llvm::map_to_vector`` and ``llvm::filter_to_vector``.
# |
# | + - New :doc:`modernize-use-bit-cast
# | + <clang-tidy/checks/modernize/use-bit-cast>` check.
# | +
# | + Finds conservative object-to-object ``memcpy`` type punning that can be
# | + rewritten as ``std::bit_cast`` in C++20 and later.
# | +
# | - 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>
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/189962
More information about the cfe-commits
mailing list