Skip to content

[libc++][test] Avoid some transitive includes in standard headers #145846

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frederick-vs-ja
Copy link
Contributor

... for mangled_names.pass.cpp

Some builds of this test file seem failing due to not finding std::errc. Also removes includes of <iostream> and <string_view> as they're unused.

... for `mangled_names.pass.cpp`

Some builds of this test file seem failing due to not finding
`std::errc`. Also removes includes of `<iostream>` and `<string_view>`
as they're unused.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner June 26, 2025 06:02
@frederick-vs-ja frederick-vs-ja added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. test-suite labels Jun 26, 2025
@llvmbot
Copy link
Member

llvmbot commented Jun 26, 2025

@llvm/pr-subscribers-libcxx

Author: A. Jiang (frederick-vs-ja)

Changes

... for mangled_names.pass.cpp

Some builds of this test file seem failing due to not finding std::errc. Also removes includes of &lt;iostream&gt; and &lt;string_view&gt; as they're unused.


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

1 Files Affected:

  • (modified) libcxx/test/libcxx/mangled_names.pass.cpp (+3-2)
diff --git a/libcxx/test/libcxx/mangled_names.pass.cpp b/libcxx/test/libcxx/mangled_names.pass.cpp
index 210c40809781e..6ea8465d870c8 100644
--- a/libcxx/test/libcxx/mangled_names.pass.cpp
+++ b/libcxx/test/libcxx/mangled_names.pass.cpp
@@ -15,11 +15,12 @@
 
 #include <cassert>
 #include <charconv>
-#include <iostream>
+#include <cstddef>
 #include <map>
 #include <typeinfo>
 #include <string>
-#include <string_view>
+#include <system_error>
+#include <utility>
 
 template <class>
 struct mangling {};

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.

I'm pretty sure errc should be provided via <charconv>.

@frederick-vs-ja
Copy link
Contributor Author

I'm pretty sure errc should be provided via <charconv>.

Yes. But it seems that relying on transitive inclusion is sometimes problematic, as least in CI.

See

@philnik777
Copy link
Contributor

I'm pretty sure errc should be provided via <charconv>.

Yes. But it seems that relying on transitive inclusion is sometimes problematic, as least in CI.

See

* https://github.com/llvm/llvm-project/actions/runs/15888063616/job/44819278583?pr=144249

That is a problem with the implementation, not the tests. We shouldn't "fix" that by changing our tests. To me this looks like our modulemap is missing an export.

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. test-suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants