Skip to content

Conversation

kazutakahirata
Copy link
Contributor

This patch simplifies EnumeratedArray::operator[] with the
injected-class-name.

This patch simplifies EnumeratedArray::operator[] with the
injected-class-name.
@llvmbot
Copy link
Member

llvmbot commented Sep 4, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

This patch simplifies EnumeratedArray::operator[] with the
injected-class-name.


Full diff: https://github.com/llvm/llvm-project/pull/156811.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/EnumeratedArray.h (+1-2)
diff --git a/llvm/include/llvm/ADT/EnumeratedArray.h b/llvm/include/llvm/ADT/EnumeratedArray.h
index fd0700c8e408a..93e1327306175 100644
--- a/llvm/include/llvm/ADT/EnumeratedArray.h
+++ b/llvm/include/llvm/ADT/EnumeratedArray.h
@@ -57,8 +57,7 @@ class EnumeratedArray {
   }
   ValueType &operator[](Enumeration Index) {
     return const_cast<ValueType &>(
-        static_cast<const EnumeratedArray<ValueType, Enumeration, LargestEnum,
-                                          IndexType, Size> &>(*this)[Index]);
+        static_cast<const EnumeratedArray &>(*this)[Index]);
   }
   IndexType size() const { return Size; }
   bool empty() const { return size() == 0; }

@kazutakahirata kazutakahirata merged commit 2157055 into llvm:main Sep 4, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250903_EnumeratedArray_self branch September 4, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants