Commit Graph

15 Commits

Author SHA1 Message Date
Jonathan Wakely
aa475c4ac8 libstdc++: Implement LWG 1203 for rvalue iostreams
This implements the resolution of LWG 1203 so that the constraints for
rvalue stream insertion/extraction are simpler, and the return type is
the original rvalue stream type not its base class.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>

libstdc++-v3/ChangeLog:

	* include/std/istream (operator>>(Istream&&, x&)): Simplify, as
	per LWG 1203.
	* include/std/ostream (operator<<(Ostream&&, const x&)):
	Likewise.
	* testsuite/27_io/basic_istream/extractors_character/char/lwg2499_neg.cc:
	Adjust dg-error pattern.
	* testsuite/27_io/basic_istream/extractors_character/wchar_t/lwg2499_neg.cc:
	Likewise.
	* testsuite/27_io/basic_istream/extractors_other/char/4.cc: Define
	is_extractable trait to replace std::__is_extractable. Make it
	work with rvalue streams as well as lvalues, to replace f() and
	g() helper functions.
	* testsuite/27_io/basic_istream/extractors_other/wchar_t/4.cc:
	Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/char/6.cc:
	Define is_insertable trait to replace std::__is_insertable. Make
	it work with rvalue streams as well as lvalues, to replace f()
	and g() helper functions.
	* testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc:
	Likewise.
	* testsuite/27_io/filesystem/path/io/dr2989.cc: Prune additional
	errors from new constraints.
	* testsuite/27_io/rvalue_streams-2.cc: Remove PR 80675 checks,
	which are no longer expected to compile.
	* testsuite/27_io/rvalue_streams.cc: Adjust existing test.
	Verify LWG 1203 changes.
2021-04-30 14:33:19 +01:00
Jakub Jelinek
99dee82307 Update copyright years. 2021-01-04 10:26:59 +01:00
Ville Voutilainen
4e096e0ff8 libstdc++: Fix the test for rvalue stream extraction
libstdc++-v3/ChangeLog:

	* testsuite/27_io/rvalue_streams.cc: Run the extraction to a char*
	for C++17 and lower only.
2020-12-15 18:03:43 +02:00
Jakub Jelinek
8d9254fc8a Update copyright years.
From-SVN: r279813
2020-01-01 12:51:42 +01:00
Jakub Jelinek
a554497024 Update copyright years.
From-SVN: r267494
2019-01-01 13:31:55 +01:00
Jakub Jelinek
85ec4feb11 Update copyright years.
From-SVN: r256169
2018-01-03 11:03:58 +01:00
Jakub Jelinek
cbe34bb5ed Update copyright years.
From-SVN: r243994
2017-01-01 13:07:43 +01:00
Jonathan Wakely
f771720378 Add c++11 effective target to tests for C++11 features
* testsuite/20_util/tuple/67844.cc: Require c++11 effective target.
	* testsuite/20_util/tuple/cons/nested_tuple_construct.cc: Likewise.
	* testsuite/27_io/rvalue_streams.cc: Likewise.

From-SVN: r239545
2016-08-17 20:23:15 +01:00
Jonathan Wakely
07c772ed4e LWG 2328 Rvalue stream extraction should use perfect forwarding
* include/std/istream (operator>>(basic_istream&&, _Tp&)): Adjust
	to use perfect forwarding (LWG 2328).
	* testsuite/27_io/rvalue_streams.cc: Test perfect forwarding.
	* doc/xml/manual/intro.xml: Document DR 2328 status.

From-SVN: r238533
2016-07-20 19:21:53 +01:00
Jakub Jelinek
818ab71a41 Update copyright years.
From-SVN: r232055
2016-01-04 15:30:50 +01:00
Jakub Jelinek
5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Richard Sandiford
aa118a03c4 Update copyright years in libstdc++-v3/
From-SVN: r206301
2014-01-02 22:30:10 +00:00
Richard Sandiford
405feeb871 Update copyright in libstdc++-v3.
From-SVN: r195701
2013-02-03 17:54:05 +00:00
Jason Merrill
4fcf08308d update license
From-SVN: r150328
2009-07-31 23:56:47 -04:00
Jason Merrill
e7f1930f94 call.c (convert_class_to_reference): Binding an lvalue to an rvalue reference is bad.
* call.c (convert_class_to_reference): Binding an lvalue to an
	rvalue reference is bad.  If the user-defined conversion is bad,
	set bad_p before merging conversions.
	(maybe_handle_ref_bind): Don't push down bad_p.
	(reference_binding): Binding an lvalue to an rvalue reference is bad.
	(convert_like_real): Give a helpful error about binding lvalue
	to rvalue reference.
	(reference_related_p): No longer static.
	* typeck.c (build_typed_address): New.
	(build_static_cast_1): Add static_cast from lvalue to &&.
	* cp-tree.h: Adjust.

	* include/bits/move.h (forward): Implement as in N2835.
	(move): Implement as in N2831.
	* include/std/istream (rvalue stream operator>>): New.
	* include/std/ostream (rvalue stream operator<<): New.

Co-Authored-By: Douglas Gregor <doug.gregor@gmail.com>

From-SVN: r150327
2009-07-31 22:26:42 -04:00