Commit Graph

285 Commits

Author SHA1 Message Date
Paolo Carlini
71743a68ec less_or_equal.cc: New.
2011-09-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/23_containers/array/comparison_operators/
	less_or_equal.cc: New.
	* testsuite/23_containers/array/comparison_operators/
	greater_or_equal.cc: Likewise.
	* testsuite/23_containers/array/comparison_operators/less.cc: Likewise.
	* testsuite/23_containers/array/comparison_operators/equal.cc: Likewise.
	* testsuite/23_containers/array/comparison_operators/not_equal.cc:
	Likewise.
	* testsuite/23_containers/array/comparison_operators/greater.cc:
	Likewise.
	* testsuite/23_containers/array/iterators/end_is_one_past.cc: Likewise.
	* testsuite/23_containers/array/capacity/empty.cc: Likewise.
	* testsuite/23_containers/array/capacity/max_size.cc: Likewise.
	* testsuite/23_containers/array/capacity/size.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/tuple_element.cc:
	Likewise.
	* testsuite/23_containers/array/tuple_interface/tuple_size.cc:
	Likewise.
	* testsuite/23_containers/array/element_access/at_out_of_range.cc:
	Likewise.
	* testsuite/23_containers/array/element_access/back.cc: Likewise.
	* testsuite/23_containers/array/element_access/front.cc: Likewise.
	* testsuite/23_containers/array/element_access/data.cc: Likewise.
	* testsuite/23_containers/array/cons/aggregate_initialization.cc:
	Likewise.
	* testsuite/23_containers/array/requirements/zero_sized_arrays.cc:
	Likewise.
	* testsuite/23_containers/array/requirements/contiguous.cc: Likewise.
	* testsuite/23_containers/array/requirements/member_swap.cc: Likewise.
	* testsuite/23_containers/array/specialized_algorithms/swap.cc:
	Likewise.
	* testsuite/23_containers/array/constexpr_get.cc: Move...
	* testsuite/23_containers/array/tuple_interface/constexpr_get.cc:
	... here.
	* testsuite/23_containers/array/requirements/get.cc: Move...
	* testsuite/23_containers/array/tuple_interface/get: ... here.
	* testsuite/23_containers/array/at_neg.cc: Move...
	* testsuite/23_containers/array/element_access: ... here.
	* testsuite/23_containers/array/requirements/constexpr_functions.cc:
	Move...
	* testsuite/23_containers/array/capacity: ... here.
	* testsuite/23_containers/array/requirements/
	constexpr_element_access.cc: Move...
	* testsuite/23_containers/array/element_access: ... here.

	* testsuite/20_util/duration/cons/1_neg.cc: Avoid -Wall warnings.
	* testsuite/20_util/tuple/creation_functions/constexpr.cc: Likewise.
	* testsuite/20_util/pair/make_pair/constexpr.cc: Likewise.
	* testsuite/20_util/time_point/nonmember/constexpr.cc: Likewise.
	* testsuite/23_containers/bitset/operations/constexpr.cc: Likewise.

	* testsuite/20_util/duration/cons/1_neg.cc: Discard bogus warning.
	* testsuite/20_util/forward/1_neg.cc: Likewise.

From-SVN: r178911
2011-09-16 16:28:31 +00:00
Paolo Carlini
fae3f4598a tuple (make_tuple, [...]): Declare constexpr.
2011-09-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple (make_tuple, forward_as_tuple): Declare constexpr.
	(_Tuple_impl<>::_Tuple_impl(_Tuple_impl<>&&)): Likewise.
	* testsuite/20_util/tuple/creation_functions/constexpr.cc: Enable
	make_tuple test.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
	line number.

From-SVN: r178904
2011-09-16 00:41:33 +00:00
Daniel Krugler
9480716c80 tuple (_Head_base<>::_M_head, [...]): Change to static constexpr functions; adjust everywhere.
2011-09-12  Daniel Krugler  <daniel.kruegler@googlemail.com>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple (_Head_base<>::_M_head, _Head_base<>::_M_tail,
	_Tuple_impl<>::_M_head, _Tuple_impl<>::_M_tail): Change to static
	constexpr functions; adjust everywhere.
	(__get_helper, get): Declare constexpr all three overloads.
	(tuple_cat): Declare constexpr; use late return type to improve
	error messages.
	* include/std/utility (__pair_get<>::__get, __pair_get<>::__move_get,
	__pair_get<>::__const_get, get): Declare all constexpr.
	* include/std/array (get): Likewise.
	* testsuite/20_util/tuple/creation_functions/constexpr.cc: Re-enable
	tuple_cat test.
	* testsuite/23_containers/array/constexpr_get.cc: New.
	* testsuite/20_util/tuple/element_access/constexpr_get.cc: Likewise.
	* testsuite/20_util/pair/constexpr_get.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
	line number.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r178799
2011-09-13 00:06:25 +00:00
Jason Merrill
62a405ddf3 * call.c (convert_class_to_reference)
(convert_class_to_reference_1): Remove.
	(reference_binding): Use build_user_type_conversion_1 instead.

From-SVN: r178789
2011-09-12 14:04:46 -04:00
Daniel Krugler
ac65b7d221 re PR libstdc++/50159 ([C++0x] tuple_cat only accepts two arguments)
2011-09-11  Daniel Krugler  <daniel.kruegler@googlemail.com>

	PR libstdc++/50159
	* include/std/tuple (tuple_cat): Reimplement according to the
	resolution of LWG 1385.
	* include/std/type_traits: Define __and_ and __or_ for zero
	arguments too; minor tweaks.
	* testsuite/20_util/tuple/creation_functions/tuple_cat.cc: New.
	* testsuite/20_util/tuple/creation_functions/constexpr.cc: Disable
	for now tuple_cat test.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line numbers.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.
	* doc/xml/manual/status_cxx200x.xml: Update.

From-SVN: r178770
2011-09-11 22:10:21 +00:00
Jason Merrill
30288f9aa2 pt.c (type_unification_real): Correct complain arg for tsubsting default template args.
* pt.c (type_unification_real): Correct complain arg for tsubsting
	default template args.

From-SVN: r178651
2011-09-07 13:11:37 -04:00
Benjamin Kosnik
a7d0c94ef1 tuple (_Tuple_impl::_M_head, _M_tail): Mark constexpr.
2011-09-06  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/tuple (_Tuple_impl::_M_head, _M_tail): Mark constexpr.
	(tuple(tuple&&)): Same.
	(tuple(const tuple<_UElements...>& __in)): Same.
	(tuple(tuple<_UElements...>&& __in)): Same.
	(tuple_cat(const tuple<_TElements...>&, const tuple<_UElements...>&)):
	Same.
	(get): Same.
	* include/std/array: Consolidate array::data usage.
	* testsuite/23_containers/array/requirements/constexpr_functions.cc:
	Remove extra include.
	* testsuite/20_util/tuple/creation_functions/constexpr.cc: New.
	* testsuite/20_util/tuple/cons/constexpr-2.cc: Add tests.
	* testsuite/20_util/tuple/cons/constexpr-3.cc: Same.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust line numbers.

From-SVN: r178620
2011-09-07 00:17:09 +00:00
Paolo Carlini
b671737962 stl_iterator.h (make_move_iterator): Implement DR2061.
2011-08-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/stl_iterator.h (make_move_iterator): Implement DR2061.
	* testsuite/24_iterators/move_iterator/dr2061.cc: New.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
	line numbers.

From-SVN: r178330
2011-08-30 15:34:50 +00:00
Benjamin Kosnik
c419868bdf constexpr.cc: Add.
2011-08-29  Benjamin Kosnik  <bkoz@redhat.com>

	* testsuite/20_util/duration/arithmetic/constexpr.cc: Add.

From-SVN: r178265
2011-08-29 23:25:17 +00:00
Benjamin Kosnik
2c4caf0ab9 tuple: Mark more constructors constexpr.
2011-08-03  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/tuple: Mark more constructors constexpr.
	* testsuite/20_util/tuple/cons/constexpr.cc: Split into and extend as:
	* testsuite/20_util/tuple/cons/constexpr-2.cc: ...this.
	* testsuite/20_util/tuple/cons/constexpr-3.cc: ... and this.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust line numbers.

2011-08-03  Benjamin Kosnik  <bkoz@redhat.com>
	    François Dumont  <francois.cppdevs@free.fr>

	* testsuite/23_containers/array/at_neg.cc: Move...
	* testsuite/23_containers/array/at.cc: ...here. Remove
	-fno-exceptions, call const at member function.


Co-Authored-By: François Dumont <francois.cppdevs@free.fr>

From-SVN: r177299
2011-08-03 21:05:14 +00:00
Jeffrey Yasskin
ce77c22f1b Propagate the source location of a template's function_decl to the template_decl built out of it.
Propagate the source location of a template's function_decl to the
template_decl built out of it.  Without this, specializations
generated before the template was defined get the location of the
closing ')' instead of the location of the template's name, which can
produce inconsistent locations between translation units, which makes
gold's ODR checker unhappy.

	* gcc/cp/pt.c (build_template_decl): Copy the function_decl's source
	location to the new template_decl.
	* gcc/testsuite/g++.old-deja/g++.pt/crash60.C: Updated.
	* libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Updated.

From-SVN: r176845
2011-07-27 18:38:48 +00:00
Benjamin Kosnik
9b9e81a0a9 move.h (move, forward): Mark constexpr.
2011-07-22  Benjamin Kosnik  <bkoz@redhat.com>
	    Daniel Krugler  <daniel.kruegler@googlemail.com>

	* include/bits/move.h (move, forward): Mark constexpr.
	* include/bits/stl_pair.h (pair): Mark move ctors constexpr.
	* testsuite/20_util/pair/make_pair/constexpr.cc: New.
	* testsuite/20_util/pair/cons/constexpr.cc: Add tests.


Co-Authored-By: Daniel Krugler <daniel.kruegler@googlemail.com>

From-SVN: r176672
2011-07-23 03:17:11 +00:00
Benjamin Kosnik
1b97ec17bc chrono: (system_clock::is_steady): Update to N3291 from is_monotonic.
2011-07-20  Benjamin Kosnik  <bkoz@redhat.com>
	    Daniel Krugler  <daniel.kruegler@googlemail.com>

	* include/std/chrono: (system_clock::is_steady): Update to N3291
	from is_monotonic.
	(time_point): Add constexpr to nonmember arithmetic operators.
	* src/chrono.cc: Modify for above.
	* src/compatibility-c++0x.cc: Same.
	* testsuite/20_util/time_point/nonmember/constexpr.cc: New.
	* testsuite/20_util/time_point/1.cc: Modify.
	* testsuite/20_util/system_clock/constexpr_data.cc: Modify.
	* testsuite/20_util/system_clock/1.cc: Modify.
	* testsuite/20_util/monotonic_clock/constexpr_data.cc: Move to...
	* testsuite/20_util/steady_clock/constexpr_data.cc: ...here.
	* testsuite/30_threads/condition_variable/members/2.cc: Modify.
	* testsuite/30_threads/condition_variable_any/members/2.cc: Modify.

From-SVN: r176549
2011-07-21 03:27:51 +00:00
Jason Merrill
6573e8a0a9 pt.c (tinst_level_tick, [...]): Replace with last_error_tinst_level.
gcc/cp/
	* pt.c (tinst_level_tick, last_template_error_tick): Replace with
	last_error_tinst_level.
	(push_tinst_level, pop_tinst_level): Adjust.
	(problematic_instantiation_changed): Adjust.
	(record_last_problematic_instantiation): Adjust.
	* error.c (cp_print_error_function): Don't print
	current_function_decl if we're in a template instantiation context.
	(print_instantiation_full_context): Always print first line.
gcc/testsuite/
	* lib/prune.exp (prune_gcc_output): Prune "In substitution" too.

From-SVN: r176366
2011-07-16 22:34:22 -04:00
Jonathan Wakely
677aad9c92 Makefile.am: Add new header.
2011-07-09  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/std/scoped_allocator: New.
	* doc/xml/manual/status_cxx200x.xml: Update.
	* testsuite/20_util/scoped_allocator/1.cc: New.
	* testsuite/20_util/scoped_allocator/propagation.cc: New.
	* testsuite/20_util/scoped_allocator/requirements/typedefs.cc: New.
	* testsuite/20_util/scoped_allocator/requirements/
	explicit_instantiation.cc: New.

From-SVN: r176079
2011-07-09 14:45:56 +01:00
Jonathan Wakely
8eeaeeca20 socket.cc: Use variable and remove attribute.
2011-06-22  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* testsuite/20_util/bind/socket.cc: Use variable and remove attribute.

From-SVN: r175322
2011-06-22 23:46:14 +01:00
Paolo Carlini
879e1011e0 invoke.cc: Avoid -Wall warnings.
2011-06-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/20_util/reference_wrapper/invoke.cc: Avoid -Wall warnings.
	* testsuite/20_util/reference_wrapper/typedefs-3.cc: Likewise.
	* testsuite/20_util/reference_wrapper/invoke-2.cc: Likewise.
	* testsuite/20_util/allocator_traits/members/allocate_hint.cc:
	Likewise.
	* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
	* testsuite/20_util/bind/socket.cc: Likewise.
	* testsuite/20_util/pointer_traits/pointer_to.cc: Likewise.
	* testsuite/util/testsuite_random.h: Likewise.

From-SVN: r175318
2011-06-22 21:46:17 +00:00
Daniel Krugler
6f17ef336c tuple (__conv_types, [...]): Add.
2011-06-20  Daniel Krugler  <daniel.kruegler@googlemail.com>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple (__conv_types, __one_by_one_convertible,
	__all_convertible): Add.
	(tuple): Use the latter.
	(tuple<_T1>): Remove.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.

Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>

From-SVN: r175204
2011-06-20 11:05:45 +00:00
Paolo Carlini
6a97dbf748 valarray (~valarray): Use noexcept.
2011-06-14  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/valarray (~valarray): Use noexcept.
	* include/bits/unique_ptr.h (~unique_ptr): Likewise.
	* testsuite/26_numerics/valarray/noexcept_move_construct.cc: New.
	* testsuite/20_util/shared_ptr/cons/noexcept_move_construct.cc:
	Likewise.
	* testsuite/20_util/unique_ptr/cons/noexcept_move_construct.cc:
	Likewise.
	* testsuite/20_util/weak_ptr/cons/noexcept_move_construct.cc:
	Likewise.

From-SVN: r175039
2011-06-14 17:48:29 +00:00
Jonathan Wakely
a9a76bae8b explicit_instantiation.cc: Add another instantiation.
2011-06-11  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* testsuite/20_util/allocator_traits/requirements/
	explicit_instantiation.cc: Add another instantiation.

From-SVN: r174957
2011-06-11 16:37:17 +01:00
Jonathan Wakely
b6a1daaa77 typedefs.cc: Check for allocator_type and value_type.
2011-06-11  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* testsuite/20_util/allocator_traits/requirements/typedefs.cc: Check
	for allocator_type and value_type.

From-SVN: r174953
2011-06-11 14:49:17 +01:00
Jason Merrill
32293e2bd6 * testsuite/20_util/bind/ref_neg.cc: Remove wrong test lines.
From-SVN: r174907
2011-06-10 10:20:28 -04:00
Jason Merrill
d784c0d6e6 ref_neg.cc: Remove dg-excess-errors, fix dg-error markup.
2011-06-10  Jason Merrill  <jason@redhat.com>

	* testsuite/20_util/bind/ref_neg.cc: Remove dg-excess-errors,
	fix dg-error markup.

From-SVN: r174906
2011-06-10 13:47:55 +00:00
Jason Merrill
793fbf0b48 * semantics.c (maybe_constant_value): Handle overflowed input.
From-SVN: r174885
2011-06-09 23:56:08 -04:00
Jason Merrill
377a536430 prune.exp (libstdc++-dg-prune): Prune notes.
* testsuite/lib/prune.exp (libstdc++-dg-prune): Prune notes.
	* testsuite/20_util/duration/cons/1_neg.cc: Remove dg-excess-errors.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/forward/1_neg.cc: Likewise.
	* testsuite/20_util/function/cmp/cmp_neg.cc: Likewise.
	* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
	* testsuite/20_util/reference_wrapper/ref_neg.cc: Likewise.
	* testsuite/20_util/tuple/comparison_operators/35480_neg.cc: Likewise.
	* testsuite/tr1/6_containers/tuple/comparison_operators/35480_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/auto_ptr_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/cons/unique_ptr_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/assign/unique_ptr_lvalue_neg.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/auto_ptr_neg.cc: Likewise.
	* testsuite/20_util/unique_ptr/cons/ptr_deleter_neg.cc: Likewise.
	* testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc: Likewise.
	* testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc: Likewise.
	* testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc: Likewise.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise.
	* testsuite/23_containers/map/operators/1_neg.cc: Likewise.
	* testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Likewise.
	* testsuite/decimal/mixed-mode-arith_neg.cc: Likewise.
	* testsuite/decimal/mixed-mode-cmp_neg.cc: Likewise.
	* testsuite/decimal/operator_neg.cc: Likewise.

From-SVN: r174884
2011-06-09 23:56:00 -04:00
Jason Merrill
3ff6097510 re PR c++/48969 (ICE with -std=c++0x)
PR c++/48969
	PR c++/44175
gcc/c-family/
	* c-common.c (max_tinst_depth): Lower default to 900.
gcc/cp/
	* error.c (subst_to_string): New.
	(cp_printer): Use it for 'S'.
	(print_instantiation_partial_context_line): Handle subst context.
	* pt.c (push_tinst_level): Handle subst context.
	(deduction_tsubst_fntype): Don't track specific substitutions.
	Use push_tinst_level.

From-SVN: r174772
2011-06-07 17:54:07 -04:00
Paolo Carlini
dd7b175ec3 type_traits (__or_, __and_): Add trivial definitions for a single element.
2011-05-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/type_traits (__or_, __and_): Add trivial definitions
	for a single element.
	* include/bits/stl_pair.h: Use __and_ in noexcept specs and
	constraints.
	(pair<>::pair(pair&&)): Define.
	(pair<>::pair(const pair<>&)): Constrain with is_convertible.
	(pair<>::pair(pair<>&&)): Likewise, remove noexcept.
	* include/std/tuple: Use __and_ in noexcept specs and constraints.
	(_Tuple_impl<>::_Tuple_impl(allocator_arg_t, const _Alloc&,
	_Tuple_impl&&)): Remove noexcept.
	(tuple<>::tuple(_UElements&&...), tuple(const tuple<_UElements...>&),
	tuple(tuple<_UElements...>&&), tuple(const pair<_U1, _U2>&),
	tuple(pair<_U1, _U2>&&)): Constrain with is_convertible.
	* testsuite/20_util/tuple/moveable2.cc: Use = delete.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
	* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.

From-SVN: r174464
2011-05-31 02:29:22 +00:00
Jonathan Wakely
59d6607d6f tuple: Restore is_convertible constraint.
2011-05-31  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/tuple: Restore is_convertible constraint.
	* testsuite/20_util/tuple/cons/allocate_noncopyable.cc: Remove.

From-SVN: r174458
2011-05-31 00:46:13 +01:00
Paolo Carlini
283e624c9f re PR libstdc++/49236 (FAIL: 20_util/weak_ptr/comparison/cmp_neg.cc)
2011-05-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/49236
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
	line number.

From-SVN: r174455
2011-05-30 21:14:01 +00:00
Jonathan Wakely
b821466067 tuple: Implement uses-allocator construction.
2011-05-30  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/tuple: Implement uses-allocator construction.
	* include/bits/allocator.h (uses_allocator): Move to ...
	* include/bits/uses_allocator.h: New file.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* testsuite/20_util/uses_allocator/cons_neg.cc: New.
	* testsuite/20_util/uses_allocator/construction.cc: New.
	* testsuite/20_util/tuple/cons/allocate_noncopyable.cc: New.
	* testsuite/20_util/tuple/cons/allocators.cc: New.

From-SVN: r174443
2011-05-30 17:31:17 +01:00
Jonathan Wakely
b8d85086ed pointer_to.cc: Fix.
2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* testsuite/20_util/pointer_traits/pointer_to.cc: Fix.

From-SVN: r174384
2011-05-28 20:15:41 +01:00
Jonathan Wakely
709544ca84 pointer_to.cc: New.
2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* testsuite/20_util/pointer_traits/pointer_to.cc: New.

From-SVN: r174381
2011-05-28 18:13:48 +01:00
Jonathan Wakely
45ba8f9f8f Makefile.am: Add new ptr_traits.h header.
2011-05-28  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/Makefile.am: Add new ptr_traits.h header.
	* include/Makefile.in: Regenerate.
	* include/bits/ptr_traits.h (pointer_traits): New.
	* include/bits/allocator.h (allocator_traits): Add.
	* include/ext/array_allocator.h (construct, destroy): Update C++0x
	versions.
	* include/ext/bitmap_allocator.h (construct, destroy): Likewise.
	* include/ext/extptr_allocator.h (construct, destroy): Likewise.
	* include/ext/malloc_allocator.h (construct, destroy): Likewise.
	* include/ext/mt_allocator.h (construct, destroy): Likewise.
	* include/ext/new_allocator.h (construct, destroy): Likewise.
	* include/ext/pool_allocator.h (construct, destroy): Likewise.
	* include/ext/throw_allocator.h (construct, destroy): Likewise.
	* testsuite/20_util/allocator_traits/requirements/typedefs.cc: New.
	* testsuite/20_util/allocator_traits/requirements/
	explicit_instantiation.cc: New.
	* testsuite/20_util/allocator_traits/members/max_size.cc: New.
	* testsuite/20_util/allocator_traits/members/select.cc: New.
	* testsuite/20_util/allocator_traits/members/construct.cc: New.
	* testsuite/20_util/allocator_traits/members/allocate_hint.cc: New.
	* testsuite/20_util/allocator_traits/members/destroy.cc: New.
	* testsuite/20_util/pointer_traits/requirements/typedefs.cc: New.
	* testsuite/20_util/pointer_traits/requirements/
	explicit_instantiation.cc: New.

From-SVN: r174380
2011-05-28 14:27:43 +01:00
Paolo Carlini
fa6642c965 dr2020.cc: Fix typo.
2011-05-24  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/20_util/duration/arithmetic/dr2020.cc: Fix typo.

From-SVN: r174152
2011-05-25 00:13:18 +00:00
Paolo Carlini
b850be9d50 re PR libstdc++/49151 ([C++0x][constexpr] chrono::duration has incorrect non-member operator semantics)
2011-05-24  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/49151
	* include/std/chrono (operator+, operator-, operator*, operator/,
	operator&): Implement LWG 2020 [WP]; specify constexpr.
	* testsuite/20_util/duration/arithmetic/dr2020.cc: New.

From-SVN: r174150
2011-05-24 23:29:19 +00:00
Paolo Carlini
4702f095fa [multiple changes]
2011-05-22  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* testsuite/20_util/bind/cv_quals_2.cc: New.

2011-05-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/49058
	* include/std/functional (_Bind<_Functor(_Bound_args...)>::
	operator()(_Args&&...)): Don't cv qualify _Functor directly
	in the default template argument, SFINAE doesn't apply when
	the functor has no arguments.
	* testsuite/20_util/bind/49058_1.cc: New.
	* testsuite/20_util/bind/49058_2.cc: Likewise.

From-SVN: r174048
2011-05-23 00:05:24 +00:00
Paolo Carlini
2789f415a1 char_traits.h: Use noexcept throughout.
2011-05-20  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/char_traits.h: Use noexcept throughout.
	* include/std/typeindex: Likewise.

	* include/std/tuple (_Tuple_impl<>_Tuple_impl(_Tuple_impl&&)): Use
	noexcept; adjust callers.
	* include/bits/stl_pair.h (pair<>::pair(pair<>&&)): Use noexcept.
	* testsuite/20_util/tuple/cons/noexcept_move_construct.cc: New.
	* testsuite/20_util/pair/cons/noexcept_move_construct.cc: Likewise.
	* testsuite/20_util/pair/noexcept_swap.cc: Likewise.
	* testsuite/20_util/pair/noexcept_move_assign.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
	line numbers.

From-SVN: r173986
2011-05-21 00:05:03 +00:00
Paolo Carlini
664e12c126 tuple (tuple_element<__i, [...]): Add.
2011-05-19  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple (tuple_element<__i, const _Tp>,
	tuple_element<__i, volatile _Tp>, tuple_element<__i,
	const volatile _Tp>, tuple_size<const _Tp>, tuple_size<volatile _Tp>,
	tuple_size<const volatile _Tp>): Add.
	* include/std/utility (tuple_size<std::pair<_Tp1, _Tp2>>): Tweak.
	* include/std/array (tuple_size<array<_Tp, _Nm>>): Likewise.
	* testsuite/20_util/tuple/cv_tuple_size.cc: New.
	* testsuite/20_util/tuple/cv_tuple_element.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Tweak dg-warning
	line number.

From-SVN: r173919
2011-05-19 20:48:39 +00:00
Paolo Carlini
173f26ae56 tuple (tuple<>::operator=(tuple&&)): Specify as noexcept.
2011-05-19  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple (tuple<>::operator=(tuple&&)): Specify as
        noexcept.
	(__get_helper): Likewise.
	(_Head_base<>::_M_head, _Tuple_impl<>::_M_head, _M_tail): Likewise.
	* include/bits/move.h (swap): Likewise.
	* include/bits/algorithmfwd.h (swap): Adjust.
	* include/bits/stl_pair.h (pair<>::operator=(pair&&)): Spec noexcept.
	* testsuite/util/testsuite_allocator.h (uneq_allocator): In C++0x
	mode, prefer delete to access control to make the type not copy
	assignable.
	* testsuite/util/testsuite_tr1.h: Add test classes.
	* testsuite/20_util/tuple/noexcept_swap.cc: New.
	* testsuite/20_util/tuple/noexcept_move_assign.cc: Likewise.
	* testsuite/25_algorithms/reverse/moveable.cc: Likewise, prefer
	delete to access control.
	* testsuite/25_algorithms/swap_ranges/moveable.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-warning
	line numbers.

From-SVN: r173917
2011-05-19 17:20:22 +00:00
Paolo Carlini
f263981ac8 [multiple changes]
2011-05-19  Daniel Krugler  <daniel.kruegler@googlemail.com>

	* testsuite/util/testsuite_tr1.h: Add test classes.
	* testsuite/20_util/is_nothrow_assignable/value.cc: Add.

2011-05-19  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/type_traits (is_assignable, is_copy_assignable,
	is_move_assignable, is_nothrow_assignable, is_nothrow_copy_assignable,
	is_nothrow_move_assignable): Add; minor tweaks elsewhere.
	(has_nothrow_copy_assign): Remove.
	* testsuite/util/testsuite_tr1.h: Add test classes.
	* testsuite/20_util/is_assignable/requirements/typedefs.cc: Add.
	* testsuite/20_util/is_assignable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_nothrow_assignable/value.cc: Likewise.
	* testsuite/20_util/is_nothrow_assignable/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/is_nothrow_assignable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_move_assignable/value.cc: Likewise.
	* testsuite/20_util/is_move_assignable/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/is_move_assignable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_copy_assignable/value.cc: Likewise.
	* testsuite/20_util/is_copy_assignable/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/is_copy_assignable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_nothrow_move_assignable/value.cc: Likewise.
	* testsuite/20_util/is_nothrow_move_assignable/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/is_nothrow_move_assignable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_nothrow_copy_assignable/value.cc: Likewise.
	* testsuite/20_util/is_nothrow_copy_assignable/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/is_nothrow_copy_assignable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
	dg-error line numbers.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Likewise.

From-SVN: r173899
2011-05-19 10:30:20 +00:00
Jonathan Wakely
cf70f97b95 shared_ptr_base.h: Use noexcept.
2011-05-18  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/bits/shared_ptr_base.h: Use noexcept. Define special member
	functions as defaulted/deleted.
	* include/bits/shared_ptr.h: Use noexcept.
	* 20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error line numbers.
	* 20_util/weak_ptr/comparison/cmp_neg.cc: Likewise.

From-SVN: r173882
2011-05-18 23:59:17 +01:00
Paolo Carlini
1aa1114b63 tuple: Use noexcept where appropriate.
2011-05-17  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/tuple: Use noexcept where appropriate.
	(tuple<>::swap): Rework implementation.
	(_Head_base<>::_M_swap_impl): Remove.
	(get(std::tuple<>&&)): Add.
	* testsuite/20_util/tuple/element_access/get2.cc: New.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Adjust dg-error
	line number.

From-SVN: r173838
2011-05-18 00:12:58 +00:00
Paolo Carlini
18eeaec47b utility (get(std::pair<>&&)): Add.
2011-05-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/utility (get(std::pair<>&&)): Add.
	* include/bits/stl_pair.h (pair::swap(pair&),
	swap(pair<>&, pair<>&)): Use noexcept.
	* include/bits/random.h (discard_block_engine<>::base,
	independent_bits_engine<>::base, shuffle_order_engine<>::base,
	random_device::entropy): Use noexcept.
	* include/std/array: Use noexcept where appropriate.
	(get(array<>&&)): Add.
	* testsuite/23_containers/array/requirements/get.cc: New.
	* testsuite/20_util/pair/get.cc: Likewise.
	* testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Tweak dg-error
	line number.

From-SVN: r173798
2011-05-16 18:09:17 +00:00
Marc Glisse
91e4938b8c PR libstdc++/47913 (again)
2011-05-04  Marc Glisse  <marc.glisse@normalesup.org>

	PR libstdc++/47913 (again)
	* include/std/ratio (ratio_add, ratio_less): Rewrite.
	* testsuite/20_util/ratio/operations/47913.cc: Extend.
	* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust dg-error
	line numbers.
	* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.

From-SVN: r173400
2011-05-04 23:23:54 +00:00
Jonathan Wakely
0f88da8d14 functional (bind): Remove from overload set when first argument type might be a socket file descriptor.
2011-05-03  Jonathan Wakely  <jwakely.gcc@gmail.com>

	* include/std/functional (bind): Remove from overload set when first
	argument type might be a socket file descriptor.
	* testsuite/20_util/bind/socket.cc: New.

From-SVN: r173279
2011-05-03 01:03:38 +01:00
Paolo Carlini
2c7a09d774 [multiple changes]
2011-04-30  Daniel Krugler  <daniel.kruegler@googlemail.com>

	* include/std/type_traits (__is_default_constructible_atom,
	__is_default_constructible_safe<, true>,
	__is_direct_constructible_new_safe,
	__is_base_to_derived_ref<,, true>, __is_lvalue_to_rvalue_ref<,, true>,
	__is_direct_constructible_ref_cast, __is_direct_constructible,
	__is_nary_constructible): Simplify; add comments throughout.

2011-04-30  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Likewise.

From-SVN: r173222
2011-04-30 19:40:06 +00:00
Paolo Carlini
1f428429c4 move.h (move_if_noexcept): Add.
2011-04-27  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/move.h (move_if_noexcept): Add.
	* testsuite/20_util/move_if_noexcept/requirements/
	explicit_instantiation.cc: New.
	* testsuite/20_util/move_if_noexcept/1.cc: Likewise.

From-SVN: r173044
2011-04-27 18:37:32 +00:00
Paolo Carlini
a47407f631 type_traits (struct underlying_type): Add.
2011-04-25  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/type_traits (struct underlying_type): Add.
	* testsuite/20_util/underlying_type/requirements/typedefs-1.cc: New.
	* testsuite/20_util/underlying_type/requirements/typedefs-2.cc:
	Likewise.
	* testsuite/20_util/underlying_type/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line number.

From-SVN: r172944
2011-04-25 23:04:16 +00:00
Jonathan Wakely
be7f782278 re PR libstdc++/48521 ([C++0x] std::result_of doesn't work with pointer to member)
2011-04-19  Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/48521
	* include/std/type_traits (result_of): Handle pointer to member.
	* include/std/functional (__invoke): Likewise.
	(_Function_to_function_pointer): Remove.
	(_Reference_wrapper_base): Provide nested types independent of
	unary_function and binary_function.
	(reference_wrapper::operator()): DR 2017.
	(ref(const A&&), cref(const A&&): Define as deleted.
	* include/std/future (async): Simplify SFINAE and use result_of to
	support pointer to member.
	* testsuite/20_util/reference_wrapper/invoke.cc: Test pointer to 
	member.
	* testsuite/20_util/reference_wrapper/24803.cc: Likewise.
	* testsuite/20_util/reference_wrapper/typedefs.cc: Test for types
	instead of derivation from unary_function and binary_function.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
	* testsuite/20_util/reference_wrapper/invoke-2.cc: New.
	* testsuite/20_util/reference_wrapper/ref_neg.c: New.
	* testsuite/20_util/reference_wrapper/typedefs-3.c: New.

From-SVN: r172709
2011-04-19 14:26:08 +01:00
Hans-Peter Nilsson
61bd5ad845 re PR testsuite/48675 (20_util/hash/chi2_quality.cc timeout)
PR testsuite/48675
	* testsuite/20_util/hash/chi2_quality.cc (test_document_words): Stub
	this part if SAMPLES < 100000.

From-SVN: r172692
2011-04-19 03:59:16 +00:00