[libcxx-commits] [libcxx] [libcxx] renames local variable to avoid shadowing werror (PR #77672)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jan 10 14:27:28 PST 2024
https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/77672
>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 1/2] [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;
}
>From 4fd5e776772500297f3e609373d15bd726076b84 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Wed, 10 Jan 2024 17:27:22 -0500
Subject: [PATCH 2/2] Apply suggestions from code review
Co-authored-by: Tacet <4922191+AdvenamTacet at users.noreply.github.com>
---
.../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 96bcf6b2c4c913..8e78c3732e2080 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
@@ -72,9 +72,9 @@ constexpr bool test() {
bidirectional_iterator<Inner*>, sentinel_wrapper<bidirectional_iterator<Inner*>>>;
using JoinView = std::ranges::join_view<ConstInconvertibleOuter>;
using sentinel_t = std::ranges::sentinel_t<JoinView>;
- using const_sentinel = std::ranges::sentinel_t<const JoinView>;
- static_assert(!std::constructible_from<sentinel_t, const_sentinel>);
- static_assert(!std::constructible_from<const_sentinel, sentinel_t>);
+ using const_sentinel_t = std::ranges::sentinel_t<const JoinView>;
+ static_assert(!std::constructible_from<sentinel_t, const_sentinel_t>);
+ static_assert(!std::constructible_from<const_sentinel_t, sentinel_t>);
}
return true;
}
More information about the libcxx-commits
mailing list