[clang-tools-extra] [clang-tidy] introduce a unused local non trival variable check (PR #76101)

Piotr Zegar via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 22 01:11:21 PST 2023


================
@@ -0,0 +1,29 @@
+.. 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.
+
+In the following example, `future2` would generate a warning that it is unused.
+
+.. code-block:: c++
+
----------------
PiotrZSL wrote:

add other example, more straight forward, like one with std::mutex.
Point in documentation what types of variables are ignored (trivially copyable, trivial, references, exception variables).
Provide description how to configure check to work on all types of non-trivial (put .* into IncludeTypeRegex)

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


More information about the cfe-commits mailing list