[clang-tools-extra] [clang-tidy] introduce a must use check (PR #76101)

Tyler Rockwood via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 21 15:12:34 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++
+
+   std::future<MyObject> future1;
+   std::future<MyObject> future2;
+   // ...
+   MyObject foo = future1.get();
+   // future2 is not used.
+
+Options
+-------
+
+.. option:: IncludeTypeRegex
+
+   Semicolon-separated list of regular expressions matching types of variables to check.
+   By default it 'std::.*mutex;std::future'.
----------------
rockwotj wrote:

Done.

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


More information about the cfe-commits mailing list