[libc-commits] [libc] [libc] Fix -Wshadow warning in raw_rwlock.h (PR #196852)

via libc-commits libc-commits at lists.llvm.org
Sun May 10 17:38:52 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/196852.diff


1 Files Affected:

- (modified) libc/src/__support/threads/raw_rwlock.h (+2-2) 


``````````diff
diff --git a/libc/src/__support/threads/raw_rwlock.h b/libc/src/__support/threads/raw_rwlock.h
index 2c14645a2e5ce..9bc1b88cabd69 100644
--- a/libc/src/__support/threads/raw_rwlock.h
+++ b/libc/src/__support/threads/raw_rwlock.h
@@ -399,8 +399,8 @@ class RawRwLock {
       // reached.
       bool timeout_flag = false;
       if (!old.can_acquire<role>(get_preference())) {
-        auto result = queue.wait<role>(serial_number, timeout, is_pshared);
-        timeout_flag = (!result.has_value() && timeout.has_value());
+        auto wait_result = queue.wait<role>(serial_number, timeout, is_pshared);
+        timeout_flag = (!wait_result.has_value() && timeout.has_value());
       }
 
       // Phase 7: unregister ourselves as a pending reader/writer.

``````````

</details>


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


More information about the libc-commits mailing list