Skip to content

[libc++] Avoid including <ostream> in <fstream> and <strstream> #116014

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 1 commit into from
Nov 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion libcxx/include/fstream
Original file line number Diff line number Diff line change
Expand Up @@ -193,14 +193,16 @@ typedef basic_fstream<wchar_t> wfstream;
#include <__fwd/fstream.h>
#include <__locale>
#include <__memory/addressof.h>
#include <__memory/unique_ptr.h>
#include <__ostream/basic_ostream.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/is_same.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <__utility/unreachable.h>
#include <cstdio>
#include <istream>
#include <ostream>
#include <streambuf>
#include <typeinfo>
#include <version>

Expand Down
3 changes: 2 additions & 1 deletion libcxx/include/strstream
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ private:
*/

#include <__config>
#include <__ostream/basic_ostream.h>
#include <istream>
#include <ostream>
#include <streambuf>
#include <version>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Expand Down
12 changes: 0 additions & 12 deletions libcxx/test/libcxx/transitive_includes/cxx23.csv
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,11 @@ forward_list limits
forward_list new
forward_list tuple
forward_list version
fstream array
fstream bitset
fstream cctype
fstream cerrno
fstream climits
fstream clocale
fstream cmath
fstream compare
fstream cstddef
fstream cstdint
Expand All @@ -427,7 +425,6 @@ fstream ctime
fstream cwchar
fstream cwctype
fstream filesystem
fstream format
fstream initializer_list
fstream iomanip
fstream ios
Expand All @@ -436,9 +433,6 @@ fstream istream
fstream limits
fstream locale
fstream new
fstream optional
fstream ostream
fstream print
fstream ratio
fstream stdexcept
fstream streambuf
Expand Down Expand Up @@ -1081,13 +1075,11 @@ string_view limits
string_view new
string_view stdexcept
string_view version
strstream array
strstream bitset
strstream cctype
strstream cerrno
strstream climits
strstream clocale
strstream cmath
strstream compare
strstream cstddef
strstream cstdint
Expand All @@ -1097,17 +1089,13 @@ strstream cstring
strstream ctime
strstream cwchar
strstream cwctype
strstream format
strstream initializer_list
strstream ios
strstream iosfwd
strstream istream
strstream limits
strstream locale
strstream new
strstream optional
strstream ostream
strstream print
strstream ratio
strstream stdexcept
strstream streambuf
Expand Down
12 changes: 0 additions & 12 deletions libcxx/test/libcxx/transitive_includes/cxx26.csv
Original file line number Diff line number Diff line change
Expand Up @@ -410,13 +410,11 @@ forward_list limits
forward_list new
forward_list tuple
forward_list version
fstream array
fstream bitset
fstream cctype
fstream cerrno
fstream climits
fstream clocale
fstream cmath
fstream compare
fstream cstddef
fstream cstdint
Expand All @@ -426,7 +424,6 @@ fstream cstring
fstream ctime
fstream cwchar
fstream cwctype
fstream format
fstream initializer_list
fstream iomanip
fstream ios
Expand All @@ -435,9 +432,6 @@ fstream istream
fstream limits
fstream locale
fstream new
fstream optional
fstream ostream
fstream print
fstream ratio
fstream stdexcept
fstream streambuf
Expand Down Expand Up @@ -1080,13 +1074,11 @@ string_view limits
string_view new
string_view stdexcept
string_view version
strstream array
strstream bitset
strstream cctype
strstream cerrno
strstream climits
strstream clocale
strstream cmath
strstream compare
strstream cstddef
strstream cstdint
Expand All @@ -1096,17 +1088,13 @@ strstream cstring
strstream ctime
strstream cwchar
strstream cwctype
strstream format
strstream initializer_list
strstream ios
strstream iosfwd
strstream istream
strstream limits
strstream locale
strstream new
strstream optional
strstream ostream
strstream print
strstream ratio
strstream stdexcept
strstream streambuf
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define TEST_STD_INPUT_OUTPUT_FILE_STREAMS_FSTREAMS_TEST_HELPERS_H

#include <cassert>
#include <cerrno>
#include <concepts>
#include <cstdio>
#include <fstream>
Expand Down
Loading