CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
58 lines
1.6 KiB
ReStructuredText
58 lines
1.6 KiB
ReStructuredText
.. title:: clang-tidy - bugprone-unused-local-non-trivial-variable
|
|
|
|
bugprone-unused-local-non-trivial-variable
|
|
==========================================
|
|
|
|
Warns when a local non trivial variable is unused within a function.
|
|
The following types of variables are excluded from this check:
|
|
|
|
* trivial and trivially copyable
|
|
* references and pointers
|
|
* exception variables in catch clauses
|
|
* static or thread local
|
|
* structured bindings
|
|
* variables with ``[[maybe_unused]]`` attribute
|
|
* name-independent variables
|
|
|
|
This check can be configured to warn on all non-trivial variables by setting
|
|
`IncludeTypes` to `.*`, and excluding specific types using `ExcludeTypes`.
|
|
|
|
In the this example, `my_lock` would generate a warning that it is unused.
|
|
|
|
.. code-block:: c++
|
|
|
|
std::mutex my_lock;
|
|
// my_lock local variable is never used
|
|
|
|
In the next example, `future2` would generate a warning that it is unused.
|
|
|
|
.. code-block:: c++
|
|
|
|
std::future<MyObject> future1;
|
|
std::future<MyObject> future2;
|
|
// ...
|
|
MyObject foo = future1.get();
|
|
// future2 is not used.
|
|
|
|
Options
|
|
-------
|
|
|
|
.. option:: IncludeTypes
|
|
|
|
Semicolon-separated list of regular expressions matching types of variables
|
|
to check. By default the following types are checked:
|
|
|
|
* `::std::.*mutex`
|
|
* `::std::future`
|
|
* `::std::basic_string`
|
|
* `::std::basic_regex`
|
|
* `::std::basic_istringstream`
|
|
* `::std::basic_stringstream`
|
|
* `::std::bitset`
|
|
* `::std::filesystem::path`
|
|
|
|
.. option:: ExcludeTypes
|
|
|
|
A semicolon-separated list of regular expressions matching types that are
|
|
excluded from the `IncludeTypes` matches. By default it is an empty list.
|