[clang-tools-extra] [clang-tidy] readability-enum-initial-value: fix self-reference detection (PR #228401)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 18:03:51 PST 2026


================
@@ -14,7 +14,7 @@ enum ERef1 {
 enum ERef2 {
   ERef2_a = 0,
   ERef2_b,
-  ERef2_last = ERef2_b,
+  ERef2_last = ((ERef2_b)),
----------------
zeyi2 wrote:

The parenthesized forms look right, but they replace the existing unparenthesized tests. 

Could you keep the original lines and add the parenthesized variants as separate enumerators, e.g. `ERef2_paren = ((ERef2_b))`?

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


More information about the cfe-commits mailing list