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

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Fri May 2 09:06:43 PDT 2025


================
@@ -0,0 +1,26 @@
+.. title:: clang-tidy - modernize-use-enum-class
+
+modernize-use-enum-class
+=============================
+
+Scoped enums (enum class) should be preferred over unscoped enums:
+https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Renum-class
+
+Unscoped enums in classes are not reported since it is a well
+established pattern to limit the scope of plain enums.
----------------
vbvictor wrote:

This should be edited into an option or removed completely, as per comment above.

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


More information about the cfe-commits mailing list