[clang-tools-extra] [clang-tidy] Adding an initial version of the "Initialized Class Members" checker. (PR #65189)

Carlos Galvez via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 5 11:24:28 PDT 2023


================
@@ -0,0 +1,32 @@
+.. title:: clang-tidy - google-cpp-init-class-members
+
+google-cpp-init-class-members
+=============================
+
+Checks that class members are initialized in constructors (implicitly or
+explicitly). Reports constructors or classes where class members are not
+initialized. The goal of this checker is to eliminate UUM (Use of
+Uninitialized Memory) bugs caused by uninitialized class members.
+
+This checker is different from ProTypeMemberInitCheck in that this checker
+attempts to eliminate UUMs as a bug class, at the expense of false
+positives.
----------------
carlosgalvezp wrote:

It's not entirely clear to me what "UUMs as a bug class" means. Could you provide an example where `ProTypeMemberInitCheck` doesn't detect the problem, and this check does? Also, why shouldn't that be fixed in `ProTypeMemberInitCheck` instead?

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


More information about the cfe-commits mailing list