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

Carlos Galvez via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 4 11:02:34 PDT 2025


================
@@ -0,0 +1,18 @@
+// RUN: %check_clang_tidy -std=c++11-or-later %s cppcoreguidelines-use-enum-class %t -- \
+// RUN:   -config="{CheckOptions: {cppcoreguidelines-use-enum-class.IgnoreUnscopedEnumsInClasses: true}}" --
+
+enum E {};
+// CHECK-MESSAGES: :[[@LINE-1]]:6: warning: enum 'E' is unscoped, use 'enum class' instead
+
+enum class EC {};
+
+struct S {
+  enum E {};
+  // CHECK-MESSAGES-NOT: :[[@LINE-1]]:8: warning: enum 'E' is unscoped, use 'enum class' instead
----------------
carlosgalvezp wrote:

We do not use CHECK-MESSAGES-NOT, please remove

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


More information about the cfe-commits mailing list