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

Christopher Di Bella via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jan 10 11:30:24 PST 2024


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

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

>From 4c3a710a05e31504857f8bebe2ca8197460fd7dd Mon Sep 17 00:00:00 2001
From: Christopher Di Bella <cjdb at google.com>
Date: Wed, 10 Jan 2024 19:28:25 +0000
Subject: [PATCH] [libcxx] renames local variable to avoid shadowing werror

Due to the inclusion of a header, a global type is was being shadowed,
which upset GCC.
---
 .../range.join/range.join.sentinel/ctor.other.pass.cpp      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

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;
 }



More information about the libcxx-commits mailing list