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

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 25 09:26:35 PDT 2025


=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?utf-8?q?Félix-Antoine?= Constantin,
=?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>


================
@@ -19,6 +19,9 @@ The check emits a warning only if an ``enum`` variable is default-initialized
 value of 0. The type can be a scoped or non-scoped ``enum``. Unions are not
 handled by the check (if it contains a member of enumeration type).
 
+Note that the ``enum`` ``std::errc`` is ignored because it is expected to be default
----------------
vbvictor wrote:

```suggestion
Note that the ``enum`` ``std::errc`` is always ignored because it is expected to be default
```
Note on 80-character limit in docs

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


More information about the cfe-commits mailing list