Skip to content
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

Merged
merged 2 commits into from Jan 10, 2024

Conversation

cjdb
Copy link
Contributor

@cjdb cjdb commented Jan 10, 2024

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.
@cjdb cjdb requested a review from philnik777 January 10, 2024 19:30
@cjdb cjdb requested a review from a team as a code owner January 10, 2024 19:30
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 10, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 10, 2024

@llvm/pr-subscribers-libcxx

Author: Christopher Di Bella (cjdb)

Changes

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

Copy link
Contributor

@philnik777 philnik777 left a 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.

Co-authored-by: Tacet <4922191+AdvenamTacet@users.noreply.github.com>
Copy link
Member

@ldionne ldionne left a 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.

@ldionne ldionne merged commit 98e3d98 into llvm:main Jan 10, 2024
7 of 9 checks passed
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

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

justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this pull request Jan 28, 2024
Due to the inclusion of a header, a global type is was being shadowed,
which upset GCC.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants