Skip to content

[libc++] Fix misplaced _LIBCPP_POP_MACROS #134874

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

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Apr 8, 2025

Fixes #134681

As a drive-by, also remove unnecessary includes from flat container tests.

Closes llvm#134681
@ldionne ldionne requested a review from a team as a code owner April 8, 2025 16:21
@ldionne ldionne added this to the LLVM 20.X Release milestone Apr 8, 2025
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Apr 8, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in LLVM Release Status Apr 8, 2025
@ldionne
Copy link
Member Author

ldionne commented Apr 8, 2025

@s-barannikov Can you please confirm that this patch solves your problem?

@llvmbot
Copy link
Member

llvmbot commented Apr 8, 2025

@llvm/pr-subscribers-libcxx

Author: Louis Dionne (ldionne)

Changes

As a drive-by, also remove unnecessary includes from flat container tests.

Closes #134681


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

5 Files Affected:

  • (modified) libcxx/include/istream (+2-2)
  • (modified) libcxx/test/std/containers/container.adaptors/flat.map/flat.map.iterators/reverse_iterator.pass.cpp (-1)
  • (modified) libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.iterators/reverse_iterator.pass.cpp (-1)
  • (modified) libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.iterators/reverse_iterator.pass.cpp (-1)
  • (modified) libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp (-1)
diff --git a/libcxx/include/istream b/libcxx/include/istream
index 4b177c41cc325..e28d99fd84e57 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -1373,6 +1373,8 @@ extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>;
 
 _LIBCPP_END_NAMESPACE_STD
 
+_LIBCPP_POP_MACROS
+
 #  endif // _LIBCPP_HAS_LOCALIZATION
 
 #  if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
@@ -1382,8 +1384,6 @@ _LIBCPP_END_NAMESPACE_STD
 #    include <type_traits>
 #  endif
 
-_LIBCPP_POP_MACROS
-
 #endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
 
 #endif // _LIBCPP_ISTREAM
diff --git a/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.iterators/reverse_iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.iterators/reverse_iterator.pass.cpp
index fc3949d70745f..7a111e228c115 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.iterators/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.map/flat.map.iterators/reverse_iterator.pass.cpp
@@ -28,7 +28,6 @@
 #include <iterator>
 
 #include "test_macros.h"
-#include <iostream>
 
 int main(int, char**) {
   {
diff --git a/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.iterators/reverse_iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.iterators/reverse_iterator.pass.cpp
index 8c1e5451f703f..35b2b9f8a9e7e 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.iterators/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.multimap/flat.multimap.iterators/reverse_iterator.pass.cpp
@@ -30,7 +30,6 @@
 #include <iterator>
 
 #include "test_macros.h"
-#include <iostream>
 
 int main(int, char**) {
   {
diff --git a/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.iterators/reverse_iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.iterators/reverse_iterator.pass.cpp
index 9d443ef8784e2..76bd49b4abd9e 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.iterators/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.multiset/flat.multiset.iterators/reverse_iterator.pass.cpp
@@ -28,7 +28,6 @@
 #include <iterator>
 
 #include "test_macros.h"
-#include <iostream>
 
 void test() {
   {
diff --git a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
index d1e4cef3de19e..a9ef87d483e6f 100644
--- a/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
+++ b/libcxx/test/std/containers/container.adaptors/flat.set/flat.set.iterators/reverse_iterator.pass.cpp
@@ -28,7 +28,6 @@
 #include <iterator>
 
 #include "test_macros.h"
-#include <iostream>
 
 void test() {
   {

Copy link
Member

@mordante mordante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@github-project-automation github-project-automation bot moved this from Needs Triage to Needs Merge in LLVM Release Status Apr 8, 2025
@ldionne ldionne added the pending-ci Merging the PR is only pending completion of CI label Apr 8, 2025
@s-barannikov
Copy link
Contributor

@s-barannikov Can you please confirm that this patch solves your problem?

It does, thank you!

@philnik777
Copy link
Contributor

@ldionne see #134776

@ldionne
Copy link
Member Author

ldionne commented Apr 8, 2025

I'm going to land this since it's not controversial and has been confirmed to fix the issue.

@ldionne ldionne merged commit 4ab86ed into llvm:main Apr 8, 2025
12 of 18 checks passed
@ldionne ldionne deleted the review/fix-pop-macro branch April 8, 2025 17:44
@github-project-automation github-project-automation bot moved this from Needs Merge to Done in LLVM Release Status Apr 8, 2025
@ldionne
Copy link
Member Author

ldionne commented Apr 8, 2025

/cherry-pick 4ab86ed

@llvmbot
Copy link
Member

llvmbot commented Apr 8, 2025

/pull-request #134895

alexrp added a commit to alexrp/zig that referenced this pull request Apr 11, 2025
alexrp added a commit to ziglang/zig that referenced this pull request Apr 11, 2025
swift-ci pushed a commit to swiftlang/llvm-project that referenced this pull request Apr 16, 2025
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. pending-ci Merging the PR is only pending completion of CI
Projects
Development

Successfully merging this pull request may close these issues.

[libcxx] Unmatched _LIBCPP_POP_MACROS with LIBCXX_ENABLE_LOCALIZATION=OFF
5 participants