New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libcxx] renames local variable to avoid shadowing werror #77672
Conversation
Due to the inclusion of a header, a global type is was being shadowed, which upset GCC.
@llvm/pr-subscribers-libcxx Author: Christopher Di Bella (cjdb) ChangesDue 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:
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;
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming GCC is now happy.
libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp
Outdated
Show resolved
Hide resolved
libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp
Outdated
Show resolved
Hide resolved
Co-authored-by: Tacet <4922191+AdvenamTacet@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for fixing. I'll merge this now to make the CI green again ASAP.
You can test this locally with the following command:git-clang-format --diff 5c9b713394486be91dc181062e5c01d696c30787 4fd5e776772500297f3e609373d15bd726076b84 -- libcxx/test/std/ranges/range.adaptors/range.join/range.join.sentinel/ctor.other.pass.cpp View the diff from clang-format here.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 8e78c3732e..1fcbe02a52 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,7 +71,7 @@ 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_t = std::ranges::sentinel_t<JoinView>;
+ using sentinel_t = std::ranges::sentinel_t<JoinView>;
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>);
|
Due to the inclusion of a header, a global type is was being shadowed, which upset GCC.
Due to the inclusion of a header, a global type is was being shadowed, which upset GCC.