[clang-tools-extra] [clang-tidy] New Option Invalid Enum Default Initialization (PR #159220)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 17 09:11:19 PDT 2025


=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/159220 at github.com>


================
@@ -88,12 +90,22 @@ class FindEnumMember : public TypeVisitor<FindEnumMember, bool> {
 
 InvalidEnumDefaultInitializationCheck::InvalidEnumDefaultInitializationCheck(
     StringRef Name, ClangTidyContext *Context)
-    : ClangTidyCheck(Name, Context) {}
+    : ClangTidyCheck(Name, Context),
+      IgnoredEnums(utils::options::parseStringList(
+          Options.get("IgnoredEnums", "::std::errc"))) {}
----------------
localspook wrote:

For an example, the values of `std::endian` are implementation defined, so some implementation might not have a zero value: https://en.cppreference.com/w/cpp/types/endian.html

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


More information about the cfe-commits mailing list