[libcxx-commits] [libcxx] [libcxx] renames local variable to avoid shadowing werror (PR #77672)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 10 11:30:51 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Christopher Di Bella (cjdb)

<details>
<summary>Changes</summary>

Due to the inclusion of a header, a global type is was being shadowed, which upset GCC.

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


1 Files Affected:

- (modified) libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp (+3-3) 


``````````diff
diff --git a/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp
index fb1e8eb1ebefa6..96bcf6b2c4c913 100644
--- a/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp
+++ b/libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp
@@ -71,10 +71,10 @@ constexpr bool test() {
         BufferView<forward_iterator<const Inner*>, sentinel_wrapper<forward_iterator<const Inner*>>,
                    bidirectional_iterator<Inner*>, sentinel_wrapper<bidirectional_iterator<Inner*>>>;
     using JoinView = std::ranges::join_view<ConstInconvertibleOuter>;
-    using sentinel = std::ranges::sentinel_t<JoinView>;
+    using sentinel_t     = std::ranges::sentinel_t<JoinView>;
     using const_sentinel = std::ranges::sentinel_t<const JoinView>;
-    static_assert(!std::constructible_from<sentinel, const_sentinel>);
-    static_assert(!std::constructible_from<const_sentinel, sentinel>);
+    static_assert(!std::constructible_from<sentinel_t, const_sentinel>);
+    static_assert(!std::constructible_from<const_sentinel, sentinel_t>);
   }
   return true;
 }

``````````

</details>


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


More information about the libcxx-commits mailing list