Repository navigation
include/container_ios: include <ostream>, not <iosfwd> - #72479
Conversation
|
jenkins test api |
1abb64a to
396b461
Compare
MaxKellermann
left a comment
There was a problem hiding this comment.
Correct fix, this was a mistake in my header cleanup PR.
Agree with @tchaikov, <iomanip> should be dropped as well. (Even if some other source gets it only through this header, then that other source is buggy and must be fixed.)
And of course, such (old) bugs do exist. |
|
This kind of bug is difficult to reproduce with GCC because of libstdc++'s many internal header dependencies; I tried If you have |
agreed. i think it just takes time to get the ecosystem (the tooling and libraries) mature enough and the distros to pickup these the toolings and libraries. |
The operator<< overloads here write to std::ostream, so the header needs its
full definition. libstdc++ and older libc++ happen to pull <ostream> in
through <iomanip>; libc++ without those transitive includes does not, and
librbd/ConfigWatcher.cc fails on macOS with:
container_ios.h:95:7: error: invalid operands to binary expression
('std::ostream' (aka 'basic_ostream<char>') and 'const char[2]')
The header has been like this since cf432cc moved these functions out
of include/types.h.
Keep <iomanip> for now: nothing here uses a manipulator, but files such as
common/frag.cc still get it only through this header.
Reported-by: Bryan Stillwell <[email protected]>
Assisted-by: Claude-Code-v2.1.294:claude-opus-5-5
Signed-off-by: Dan van der Ster <[email protected]>
396b461 to
3228c75
Compare
|
Keeping this one open rather than closing it in favour of #72481: this PR only swaps Dropping |
include/container_ios.hdefinesoperator<<overloads onstd::ostreambut only includes<iosfwd>. libstdc++ and older libc++ pull<ostream>in through<iomanip>; newer libc++ doesn't, andlibrbd/ConfigWatcher.ccfails on macOS:Reproduced with Apple clang 21 and
-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDESon a file that includes only this header; including<ostream>fixes it. Reported by @bstillwell while building the macOS series.Checklist
🤖 Generated with Claude Code