Testsuite cleanup

Christopher Jefferson chris@bubblescope.net
Mon Aug 31 17:52:00 GMT 2009


This patch performs some cleanup and extensions to the testsuite. I  
hope this patch, while big, is mostly obvious. If you'd like it in  
some smaller, better defined chunks, I'll split it up. After this  
patch, I believe the only parts of chapter 25 which is not updated for  
C++0x and tested are stable_partition, stable_sort and inplace_merge.  
I have another patch for those in the pipeline.

I draw attention to two parts of this patch:

1) _GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING was only necessary while  
we had C++03 rvalue-emulation. Now it is removable, so I do so.

2) The following code:

template<typename U>
void function(const U& u) { ... }

template<typename U>
void function(U&& u) { ... }

Is almost certainly wrong, wherever it is written. The problem is that  
non-const lvalues will match the second function call,  with U = int&  
(for example). If we then move from the u, code will break.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: testsuite_cleanup.patch
Type: application/octet-stream
Size: 25033 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20090831/78d41a6d/attachment.obj>
-------------- next part --------------


     2009-08-30  Chris Jefferson <chris@bubblescope.net>
	* testsuite/25_algorithms/copy_n/move_iterators/1.cc: Remove
	_GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING.
	* testsuite/25_algorithms/inplace_merge/1.cc: Fix broken test.
	* testsuite/25_algorithms/move_backward/1.cc: Remove
	_GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING.
	* testsuite/25_algorithms/move/1.cc: Likewise.
	* testsuite/25_algorithms/copy_backward/move_iterators/1.cc: Likewise.
	* testsuite/25_algorithms/copy/move_iterators/1.cc: Likewise.
	* testsuite/25_algorithms/random_shuffle/moveable.cc: New.
	* testsuite/25_algorithms/nth_element/moveable.cc: Add test for
	predicated version.
	* testsuite/25_algorithms/partial_sort/moveable.cc: Remove
	_GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING and add test for predicated
	version.
	* testsuite/25_algorithms/next_permutation/moveable.cc: New.
	* testsuite/25_algorithms/sort/moveable.cc: Enable, Remove
	_GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING, add predicated version test.
	* testsuite/25_algorithms/prev_permutation/moveable.cc: New.
	* testsuite/25_algorithms/unique/moveable.cc: Add test for predicated
	version.
	* testsuite/25_algorithms/heap/moveable2.cc: New.
	* testsuite/25_algorithms/heap/moveable.cc: Remove
	_GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING.
	* testsuite/util/testsuite_rvalref.h: Remove
	_GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING.
	* testsuite/util/testsuite_iterators.h: Fix invalid moving bug in
	C++0x mode.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
	move_iterators/1.cc: Remove _GLIBCXX_TESTSUITE_ALLOW_RVALREF_ALIASING.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/
	move_iterators/1.cc: Likewise.


More information about the Libstdc++ mailing list