[libc-commits] [libc] [libc] Fix -Wshadow warning in HashTable/table.h (PR #196857)

via libc-commits libc-commits at lists.llvm.org
Sun May 10 17:50:23 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Nico Weber (nico)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) libc/src/__support/HashTable/table.h (+3-3) 


``````````diff
diff --git a/libc/src/__support/HashTable/table.h b/libc/src/__support/HashTable/table.h
index f42eead2efcf2..578f01e0e2c55 100644
--- a/libc/src/__support/HashTable/table.h
+++ b/libc/src/__support/HashTable/table.h
@@ -208,10 +208,10 @@ struct HashTable {
 
   LIBC_INLINE HashTable *grow() const {
     size_t hint = full_capacity() + 1;
-    HashState state = this->state;
+    HashState new_state = state;
     // migrate to a new random state
-    state.update(&hint, sizeof(hint));
-    HashTable *new_table = allocate(hint, state.finish());
+    new_state.update(&hint, sizeof(hint));
+    HashTable *new_table = allocate(hint, new_state.finish());
     // It is safe to call unsafe_insert() because we know that:
     // - the new table has enough capacity to hold all the entries
     // - there is no duplicate key in the old table

``````````

</details>


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


More information about the libc-commits mailing list