gcc/libstdc++-v3/testsuite/27_io
Jonathan Wakely ecba8547dd libstdc++: Implement std::emit_on_flush etc.
This adds the manipulators for use with basic_osyncstream. In order to
detect when an arbitrary basic_ostream<C,T> is the base class of a
basic_syncbuf<C,T,A> object, introduce a new intermediate base class
that stores the data members. The new base class stores a pointer and
two bools, which wastes (sizeof(void*) - 2) bytes of padding. It would
be possible to use the two least significant bits of the pointer for the
two bools, at least for targets where alignof(basic_streambuf) > 2, but
that's left as a possible change for a future date.

Also define basic_syncbuf::overflow to override the virtual function in
the base class, so that single characters can be inserted into the
stream buffer. Previously the default basic_streambuf::overflow
implementation was used, which drops the character on the floor.

libstdc++-v3/ChangeLog:

	* include/std/ostream (__syncbuf_base): New class template.
	(emit_on_flush, noemit_on_flush, flush_emit): New manipulators.
	* include/std/syncstream (basic_syncbuf): Derive from
	__syncbuf_base instead of basic_streambuf.
	(basic_syncbuf::operator=): Remove self-assignment check.
	(basic_syncbuf::swap): Remove self-swap check.
	(basic_syncbuf::emit): Do not skip pubsync() call if sequence
	is empty.
	(basic_syncbuf::sync): Remove no-op pubsync on stringbuf.
	(basic_syncbuf::overflow): Define override.
	* testsuite/27_io/basic_syncstream/basic_ops/1.cc: Test
	basic_osyncstream::put(char_type).
	* testsuite/27_io/basic_ostream/emit/1.cc: New test.
2020-11-11 00:19:40 +00:00
..
basic_filebuf Update copyright years. 2020-01-01 12:51:42 +01:00
basic_fstream libstdc++: Enable tests that incorrectly require cxx11-abi 2020-10-14 12:52:46 +01:00
basic_ifstream Update copyright years. 2020-01-01 12:51:42 +01:00
basic_ios libstdc++: Require c++98_only effective target for a test 2020-07-02 21:27:22 +01:00
basic_iostream Update copyright years. 2020-01-01 12:51:42 +01:00
basic_istream libstdc++: Do not set eofbit eagerly in operator>>(istream&, char(&)[N]) 2020-08-06 19:23:14 +01:00
basic_istringstream libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_ofstream Update copyright years. 2020-01-01 12:51:42 +01:00
basic_ostream libstdc++: Implement std::emit_on_flush etc. 2020-11-11 00:19:40 +00:00
basic_ostringstream libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_streambuf Update copyright years. 2020-01-01 12:51:42 +01:00
basic_stringbuf libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_stringstream libstdc++: Add remaining C++20 additions to <sstream> [P0408R7] 2020-11-10 19:22:47 +00:00
basic_syncbuf libstdc++: Add c++2a <syncstream> 2020-11-02 10:41:32 -08:00
basic_syncstream libstdc++: Implement std::emit_on_flush etc. 2020-11-11 00:19:40 +00:00
filesystem libstdc++: Avoid warnings in tests 2020-10-29 22:47:21 +00:00
fpos tolerate padding in mbstate_t 2020-01-23 16:36:34 -03:00
headers libstdc++: Require c++98_only effective target for some tests 2020-07-02 21:27:12 +01:00
ios_base libstdc++: Add C++11 member functions for ios::failure in old ABI 2020-10-08 14:45:37 +01:00
manipulators Update copyright years. 2020-01-01 12:51:42 +01:00
objects Update copyright years. 2020-01-01 12:51:42 +01:00
types libstdc++: Add deprecated attributes to old iostream members 2020-08-19 12:13:23 +01:00
rvalue_streams-2.cc Update copyright years. 2020-01-01 12:51:42 +01:00
rvalue_streams.cc Update copyright years. 2020-01-01 12:51:42 +01:00