[clang-tools-extra] Add check 'modernize-use-enum-class' (PR #138282)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Fri May 9 09:44:46 PDT 2025


================
@@ -0,0 +1,31 @@
+.. title:: clang-tidy - cppcoreguidelines-use-enum-class
+
+cppcoreguidelines-use-enum-class
+=============================
+
+Finds plain non-class ``enum`` definitions that could use ``enum class``.
----------------
vbvictor wrote:

```suggestion
Finds unscoped (non-class) ``enum`` declarations and suggests using ``enum class`` instead.
```
1. I think we should use original cppreference syntax (unscoped)
2. definitions -> declarations because in tests we also warn on `enum ForwardE`
3. rephrased "could use" because we actually don't check any conditions before giving warning.

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


More information about the cfe-commits mailing list