Commit Graph

4548 Commits

Author SHA1 Message Date
François Dumont 181a5a136f 2012-08-10 François Dumont <fdumont@gcc.gnu.org>
Ollie Wild  <aaw@google.com>

	* include/bits/hashtable.h
	(_Hashtable<>_M_insert_multi_node(hash_code, node_type*)): New.
	(_Hashtable<>_M_insert(_Args&&, false_type)): Use latter.
	(_Hashtable<>::_M_emplace(false_type, _Args&&...)): Likewise.
	(_Hashtable<>::_M_insert_bucket): Replace by ...
	(_Hashtable<>::_M_insert_unique_node(size_type, hash_code, node_type*)):
	... this, new.
	(_Hashtable<>::_M_insert(_Args&&, true_type)): Use latter.
	(_Hashtable<>::_M_emplace(true_type, _Args&&...)): Likewise.
	* include/bits/hashtable_policy.h (_Map_base<>::operator[]): Use
	latter, emplace the value_type rather than insert.
	* include/std/unordered_map: Include tuple.
	* include/std/unordered_set: Likewise.
	* testsuite/util/testsuite_counter_type.h: New.
	* testsuite/23_containers/unordered_map/operators/2.cc: New.

Co-Authored-By: Ollie Wild <aaw@google.com>

From-SVN: r190355
2012-08-13 19:43:19 +00:00
Marc Glisse 6a9573cc7b re PR libstdc++/54112 (including complex.h and complex fails in C++03)
2012-08-13  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/54112
	* include/c_compatibility/complex.h: Undefine complex, always
	include system's complex.h if present.
	* testsuite/26_numerics/complex/c99.cc: New testcase.
	* testsuite/17_intro/headers/c++1998/complex.cc: Likewise.
	* doc/xml/manual/numerics.xml: Document it.

From-SVN: r190340
2012-08-13 11:55:00 +00:00
Jonathan Wakely 9ab48d6e6c acinclude.m4: Update references to final C++11 standard.
* acinclude.m4: Update references to final C++11 standard.
	* include/bits/shared_ptr.h: Likewise.
	* include/bits/shared_ptr_base.h: Likewise.
	* include/bits/unique_ptr.h: Likewise.
	* include/std/chrono: Likewise.
	* include/std/thread: Likewise.

From-SVN: r190271
2012-08-09 23:45:20 +01:00
Benjamin Kosnik 743ca87fe8 re PR libstdc++/54005 (Use __atomic_always_lock_free in libstdc++ is_lock_free instead of __atomic_is_lock_free)
2012-08-07  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/54005
	* include/std/atomic: Use __atomic_always_lock_free.
	* include/bits/atomic_base.h: Same.

From-SVN: r190216
2012-08-07 23:03:55 +00:00
Paolo Carlini ef859c9d3c [multiple changes]
2012-08-06  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/decimal/mixed-mode-cmp_neg.cc: Add test variable; minor
	tweaks.
	* testsuite/decimal/unary-arith.cc: Likewise.
	* testsuite/decimal/ctor.cc: Likewise.
	* testsuite/decimal/conversion-to-integral.cc: Likewise.
	* testsuite/decimal/make-decimal.cc: Likewise.
	* testsuite/decimal/comparison.cc: Likewise.
	* testsuite/decimal/incdec-memfunc.cc: Likewise.
	* testsuite/decimal/conversion-to-generic-float.cc: Likewise.
	* testsuite/decimal/compound-assignment-memfunc.cc: Likewise.
	* testsuite/decimal/cast_neg.cc: Likewise.
	* testsuite/decimal/incdec.cc: Likewise.
	* testsuite/decimal/mixed-mode-arith_neg.cc: Likewise.
	* testsuite/decimal/binary-arith.cc: Likewise.
	* testsuite/decimal/conversion-from-float.cc: Likewise.
	* testsuite/decimal/conversion-from-integral.cc: Likewise.
	* testsuite/decimal/compound-assignment.cc: Likewise.

2012-08-06  Peter Bergner  <bergner@vnet.ibm.com>

	PR libstdc++/54036
	* include/decimal/decimal.h (_DEFINE_DECIMAL_UNARY_OP): Use _Op as
	a unary operator.
	* testsuite/decimal/pr54036-1.cc: New test.
	* testsuite/decimal/pr54036-2.cc: Likewise.
	* testsuite/decimal/pr54036-3.cc: Likewise.

From-SVN: r190186
2012-08-06 18:06:42 +00:00
Paolo Carlini 75235f0597 revert: stl_map.h (operator[](key_type&&)): Replace std::make_pair with value_type.
2012-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

	Revert:
	2012-08-03  Ollie Wild  <aaw@google.com>
		    Richard Smith  <richardsmith@google.com>

	* include/bits/stl_map.h (operator[](key_type&&)): Replace
	std::make_pair with value_type.
	* testsuite/23_containers/map/operators/2.cc: New test.

From-SVN: r190142
2012-08-04 11:44:28 +00:00
François Dumont 4d02a6956b functions.h (__check_partition_lower_aux): Remove redundant comparison with pivot value.
2012-08-03  François Dumont  <fdumont@gcc.gnu.org>

	* include/debug/functions.h (__check_partition_lower_aux): Remove
	redundant comparison with pivot value.
	(__check_partition_upper_aux): Likewise.

From-SVN: r190134
2012-08-03 19:34:49 +00:00
Ollie Wild 2222df9f39 stl_map.h (operator[](key_type&&)): Replace std::make_pair with value_type.
2012-08-03  Ollie Wild  <aaw@google.com>
	    Richard Smith  <richardsmith@google.com>

	* include/bits/stl_map.h (operator[](key_type&&)): Replace
	std::make_pair with value_type.
	* testsuite/23_containers/map/operators/2.cc: New test.

Co-Authored-By: Richard Smith <richardsmith@google.com>

From-SVN: r190128
2012-08-03 15:26:36 +00:00
Jonathan Wakely 6e48db73ed memory: Include auto_ptr.h later.
* include/std/memory: Include auto_ptr.h later.
	* include/bits/shared_ptr.h (shared_ptr(auto_ptr<_Up>&&): Remove
	definition.
	* include/bits/shared_ptr_base.h (__shared_ptr(auto_ptr<_Up>&&):
	Likewise.
	* include/bits/unique_ptr.h (unique_ptr(auto_ptr<_Up>&&): Likewise.
	* include/backward/auto_ptr.h (unique_ptr(auto_ptr<_Up>&&): Define.
	(shared_ptr(auto_ptr<_Up>&&, __shared_ptr(auto_ptr<_Up>&&): Likewise.
	* include/std/future: Reduce header dependencies.
	* testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line
	numbers.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Likewise.
	* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Likewise.

From-SVN: r190109
2012-08-03 01:27:48 +01:00
François Dumont 62d3d3d431 c++config (_GLIBCXX_END_NAMESPACE_CONTAINER): Fix order of closures.
2012-07-30  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/c++config (_GLIBCXX_END_NAMESPACE_CONTAINER): Fix
	order of closures.
	(_GLIBCXX_END_NAMESPACE_ALGO): Likewise.

From-SVN: r189986
2012-07-30 20:08:59 +00:00
François Dumont 78aa145d9e re PR libstdc++/54075 ([4.7.1] unordered_map insert still slower than 4.6.2)
2012-07-29  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/54075
	* include/bits/hashtable_policy.h
	(_Prime_rehash_policy::_M_next_bkt): Add a growth factor set to 2
	to boost growth in the number of buckets.
	* testsuite/performance/23_containers/insert/unordered_set.cc: New.

From-SVN: r189938
2012-07-29 16:44:18 +00:00
François Dumont 2514d7f1ff re PR libstdc++/54075 ([4.7.1] unordered_map insert still slower than 4.6.2)
2012-07-25  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/54075
	* include/bits/hashtable.h
	(_Hashtable<>::_Hashtable(_InputIterator, _InputIterator,
	size_type, ...): Remove std::max usage to guarantee that hashtable
	state is consistent with hash policy state.
	(_Hashtable<>::rehash): Likewise. Set _M_prev_resize to 0 to avoid
	the hashtable to be shrinking on next insertion.
	* testsuite/23_containers/unordered_set/modifiers/reserve.cc: New.
	* testsuite/23_containers/unordered_multiset/modifiers/reserve.cc: New.
	* testsuite/23_containers/unordered_map/modifiers/reserve.cc: New.
	* testsuite/23_containers/unordered_multimap/modifiers/reserve.cc: New.

From-SVN: r189863
2012-07-25 19:32:48 +00:00
Chip Salzenberg d069a690ee re PR libstdc++/54025 (atomic<chrono::duration> won't compile: chrono::duration::duration() is not C++11 compliant)
2012-07-20  Chip Salzenberg  <chip@pobox.com>
	    Jonathan Wakely  <jwakely.gcc@gmail.com>

	PR libstdc++/54025
	* include/std/chrono (duration<>::duration): Fix per C++11.
	* testsuite/20_util/duration/cons/54025.cc: New.
	* testsuite/20_util/duration/cons/constexpr.cc: Adjust.

Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>

From-SVN: r189711
2012-07-20 09:48:57 +00:00
Jonathan Wakely eb407c3432 re PR libstdc++/53270 (Error when bootstrapping gcc on hppa2.0-unknown-linux-gcc)
PR libstdc++/53270
	* include/ext/concurrence.h (__mutex, __recursive_mutex, __cond): Use
	NSDMI in C++98 mode too.
	* include/ext/rope: Add system_header pragma.
	(_Refcount_Base, _Rope_RopeRep): Use NSDMI.
	(_Rope_RopeRep::~_Rope_RopeRep): Destroy mutex.

From-SVN: r189553
2012-07-16 22:57:18 +01:00
Jonathan Wakely 8db81fb2fe re PR libstdc++/53978 (Missing static const definitions in <bits/alloc_traits.h>)
PR libstdc++/53978
	* include/bits/alloc_traits.h (allocator_traits): Define static
	constants.
	* include/bits/ptr_traits.h (pointer_traits): Likewise.
	* include/ext/alloc_traits.h (__allocator_always_compares_equal):
	Likewise.

From-SVN: r189547
2012-07-16 21:43:11 +01:00
Paolo Carlini 57cee56a1e re PR libstdc++/53657 ([C++11] pair(pair&&) move constructor is non-trivial)
2012-07-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/53657
	* include/bits/stl_pair.h (pair<>::pair(pair&&)): Declare defaulted,
	per C++11.
	* include/bits/stl_map.h (map<>::insert(_Pair&&), map<>::insert
	(const_iterator, _Pair&&)): Constrain with std::is_constructible,
	per LWG2005.
	* include/bits/stl_multimap.h (multimap<>::insert(_Pair&&),
	multimap<>::insert(const_iterator, _Pair&&)): Likewise.
	* include/bits/hashtable_policy.h (_Insert<>::insert(_Pair&&),
	_Insert<>::insert(const_iterator, _Pair&&)): Likewise.
	* include/debug/unordered_map: Adjust.
	* include/debug/map.h: Likewise.
	* include/debug/multimap.h: Likewise.
	* include/profile/unordered_map: Likewise.
	* include/profile/map.h: Likewise.
	* include/profile/multimap.h: Likewise.

From-SVN: r189456
2012-07-13 08:59:58 +00:00
Paolo Carlini f8b54112b5 re PR libstdc++/53872 ([C++11] ADL bug in std::thread)
2012-07-06  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/53872
	* include/std/thread (thread::_M_make_routine): Qualify make_shared
	to prevent ADL.
	* testsuite/30_threads/thread/adl.cc: New.

From-SVN: r189329
2012-07-06 13:55:58 +00:00
Jonathan Wakely b63d8901d1 * include/std/condition_variable: Update copyright years.
From-SVN: r189277
2012-07-05 02:14:35 +01:00
Jonathan Wakely 7f426c93a7 re PR libstdc++/53830 (condition_variable_any - deadlock issue)
PR libstdc++/53830
	* include/std/condition_variable (condition_variable_any::wait):
	Move _Unlock type to class scope.
	(condition_variable_any::wait_until): Reuse it.
	* testsuite/30_threads/condition_variable_any/53830.cc: New.

From-SVN: r189268
2012-07-04 23:17:18 +01:00
Paolo Carlini c128d2031e re PR libstdc++/53840 ([C++11] DR 921. Rational Arithmetic should use template aliases)
2012-07-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/53840
	* include/std/ratio (ratio_multiply, ratio_divide, ratio_add,
	ratio_subtract): Use template aliases.
	* include/std/chrono (duration<>::duration(const duration<>&),
	duration_cast): Adjust.
	* testsuite/20_util/ratio/operations/53840.cc: New.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
	* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.

From-SVN: r189239
2012-07-03 19:24:07 +00:00
Paolo Carlini d695f91575 revert: re PR libstdc++/49561 ([C++0x] std::list::size complexity)
2012-07-02  Paolo Carlini  <paolo.carlini@oracle.com>

	Revert:
	2011-10-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/49561
	* include/bits/stl_list.h (_List_base<>::_List_impl::_M_size):
	Add in C++0x mode.
	(_List_base<>::_List_impl, _List_base<>::_M_get_node,
	_List_base<>::_M_put_node, _List_base<>::_List_base(_List_base&&),
	list<>::size, list<>::swap, list<>::splice): Use it.
	(operator==(const list<>&, const list<>&)): Rewrite in C++0x mode.
	* include/bits/list.tcc (list<>::erase): Likewise.
	(list<>::merge): Adjust in C++0x mode.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/list/requirements/dr438/insert_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.

From-SVN: r189185
2012-07-03 00:47:17 +00:00
Benjamin Kosnik e07b233d2e c++config: Remove __regex nested namespace.
2012-06-27  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/c++config: Remove __regex nested namespace.
	* include/bits/regex_compiler.h: Change __regex to
	__detail. Adjust doxygen markup, add regex-details group.
	* include/bits/regex_constants.h: Same.
	* include/bits/regex_cursor.h: Same.
	* include/bits/regex_error.h: Same.
	* include/bits/regex_grep_matcher.h: Same.
	* include/bits/regex_grep_matcher.tcc: Same.
	* include/bits/regex_nfa.h: Same.
	* include/bits/regex_nfa.tcc: Same.
	* include/bits/regex.h: Same. Remove static from global constants.

	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers.

	* include/bits/locale_classes.tcc: Add use_facet, has_facet to
	locales group.

From-SVN: r189039
2012-06-28 07:50:34 +00:00
Edward Smith-Rowland 9212fcb872 Add C++11 isms to tr2/dynamic_bitset and tr2/bool_set.
From-SVN: r188967
2012-06-26 00:14:00 +00:00
Jonathan Wakely ea15487933 re PR libstdc++/53578 (include/ext/concurrence.h relies on ill-formed narrowing conversions)
PR libstdc++/53578
	* include/ext/concurrence.h (__recursive_mutex::_S_destroy): Fix
	narrowing conversion.
	* include/std/mutex (__recursive_mutex_base::_S_destroy): Likewise.

From-SVN: r188646
2012-06-15 01:27:29 +01:00
Jonathan Wakely 01f83b7d26 re PR libstdc++/53270 (Error when bootstrapping gcc on hppa2.0-unknown-linux-gcc)
PR libstdc++/53270
	* include/ext/concurrence.h (__mutex, __recursive_mutex, __cond): Use
	NSDMI in C++11 mode.
	* include/ext/rope (_Refcount_Base): Likewise. Destroy mutex in
	destructor when initialized by function.

From-SVN: r188637
2012-06-14 23:20:52 +01:00
Jonathan Wakely 5c8dd62a1b re PR libstdc++/53648 ([C++11] nested empty tuples)
PR libstdc++/53648
	* include/std/tuple (__empty_not_final): Do not use EBO for tuples.
	* testsuite/20_util/tuple/53648.cc: New.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error line
	number.

From-SVN: r188636
2012-06-14 23:07:33 +01:00
Benjamin Kosnik 7033d59e69 re PR libstdc++/53543 ([unordered_map] conflict with __is_convertible clang intrinsic)
2012-05-31  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/53543
	* include/bits/hashtable_policy.h (_Insert::__is_convertible):
	Rename to __is_conv to avoid clash with clang built-in.

From-SVN: r188088
2012-05-31 23:02:18 +00:00
François Dumont 80a009e565 2012-05-29 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_tempbuf.h (__uninitialized_construct_buf)
	(__uninitialized_construct_buf_dispatch<>::__ucr): Fix to work
	with iterator returning rvalue.
	* testsuite/25_algorithms/stable_sort/3.cc: New.

From-SVN: r187985
2012-05-29 19:29:29 +00:00
Dodji Seketeli 650dc14a73 PR c++/53322 - -Wunused-local-typedefs is not enabled by Wall or Wunused
As the audit trail of this shows, -Wunused-local-typedefs is not
turned on by -Wunused after all.  Sigh.

Now that we have the EnabledBy construct for the *.opt files, it's
more precise and concise to use that to make -Wunused-local-typedefs
be triggered by -Wunused.

I have changed the gcc+.dg/warn/Wunused-local-typedefs.C test case to
make it use -Wunused instead of -Wunused-local-typedefs.  I had to
adjust it to avoid the warnings due to the other -W* options triggered
by -Wunused there.

While testing the compiler, it turned out that some local typedefs
were not being used when the experimental "Concepts" support is turned
off, in the libstdc++ test suite.  I also had to remove some obvious
useless local typedef usage in the fortran front-end.  Fixed thus.

Bootstrapped and tested on x86_64-unknown-linux-gnu against trunk.

gcc/c-family/

	PR c++/53322
	* c.opt (Wunused-local-typedefs): Use EnabledBy(Wunused).

libstdc++-v3/

	PR c++/53322
	* include/bits/stl_algobase.h (lower_bound)
	(lexicographical_compare): Do not declare unused local typedefs
	here when Concepts are turned off.

gcc/fortran/

	PR c++/53322
	* f95-lang.c (gfc_init_builtin_functions): Remove the unused
	typedef builtin_type.

gcc/testsuite/

	PR c++/53322
	* g++.dg/warn/Wunused-local-typedefs.C: Adjust to use -Wunused
	instead of -Wunused-local-typedefs.

From-SVN: r187757
2012-05-22 05:50:26 +02:00
Paolo Carlini 5ac4e73a1d re PR libstdc++/53339 (unordered_map::iterator requires Value to be complete type)
2012-05-15  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/53339
	* include/bits/hashtable_policy.h (__detail::_Identity,
	__detail::_Select1st): Add.
	(_Map_base, _Hashtable_base): Use the latter, adjust parameters.
	* include/bits/hashtable.h (_Hashtable::__key_extract): Adjust.
	* include/bits/unordered_set.h (__uset_hashtable, __umset_hashtable):
	Likewise.
	* include/bits/unordered_map.h (__umap_hashtable, __ummap_hashtable):
	Likewise.
	* include/bits/stl_function.h (_Identity, _Select1st, _Select2nd)
	Unconditionally derive from unary_function.
	* include/ext/functional (identity, select1st, select2nd): Remove
	#ifdef __GXX_EXPERIMENTAL_CXX0X__ bits.
	* testsuite/23_containers/unordered_map/requirements/53339.cc: New.
	* testsuite/23_containers/unordered_multimap/requirements/
	53339.cc: Likewise.

From-SVN: r187515
2012-05-15 10:00:19 +00:00
François Dumont 0545ebf2dc re PR libstdc++/53263 (priority_queue is very slow if -D_GLIBCXX_DEBUG is used)
2012-05-11  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/53263
	* include/debug/safe_iterator.h (__gnu_debug::__base): Move...
	* include/debug/functions.h: ... Here. Add debug function
	overloads to perform checks on normal iterators when possible.
	* include/debug/macros.h (__glibcxx_check_heap)
	(__glibcxx_check_heap_pred): Use __gnu_debug::__base on iterator range.

From-SVN: r187414
2012-05-11 19:21:31 +00:00
DJ Delorie 586518549e random.tcc (seed_seq::generate): Cast max() operands to size_t to ensure a template match.
* include/bits/random.tcc (seed_seq::generate): Cast max()
operands to size_t to ensure a template match.
* include/std/bitset (_M_copy_from_ptr): Cast min() operands to
size_t to ensure a template match.

From-SVN: r187376
2012-05-10 16:32:47 -04:00
Benjamin Kosnik d632488ae0 re PR libstdc++/44015 (template parameters not documented)
2012-05-02  Benjamin Kosnik  <bkoz@redhat.com>

	PR libstdc++/44015
	* include/bits/basic_ios.h: Add tparam markup for
	* doxygen.  include/bits/basic_string.h: Same.
	* include/bits/forward_list.h: Same.
	* include/bits/stl_bvector.h: Same.
	* include/bits/stl_deque.h: Same.
	* include/bits/stl_list.h: Same.  include/bits/stl_map.h:
	* Same.  include/bits/stl_multimap.h: Same.
	* include/bits/stl_multiset.h: Same.
	* include/bits/stl_pair.h: Same.
	* include/bits/stl_queue.h: Same.
	* include/bits/stl_set.h: Same.
	* include/bits/stl_stack.h: Same.
	* include/bits/stl_vector.h: Same.
	* include/bits/unordered_map.h: Same.
	* include/bits/unordered_set.h: Same.  include/std/array:
	* Same.  include/std/atomic: Same.  include/std/fstream:
	* Same.  include/std/istream: Same.  include/std/ostream:
	* Same.  include/std/sstream: Same.
	* include/std/streambuf: Same.
	* testsuite/23_containers/deque/requirements/dr438/*:
          Adjust line numbers.
	* testsuite/23_containers/list/requirements/dr438/*: Same.
	* testsuite/23_containers/vector/requirements/dr438/*: Same.

From-SVN: r187066
2012-05-02 22:25:28 +00:00
Benjamin Kosnik 63dc7fbee0 hashtable_policy.h: Correct namepace nesting for _Hashtable forward declaration.
2012-05-02  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/hashtable_policy.h: Correct namepace nesting for
	_Hashtable forward declaration.

From-SVN: r187052
2012-05-02 16:22:06 +00:00
François Dumont b7a9facb2c re PR libstdc++/53115 (_Hashtable::_M_rehash_aux(false_type) is broken)
2012-05-01  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/53115
	* include/bits/hashtable.h
	(_Hashtable<>::_M_rehash_aux(size_type, false_type)): Fix buckets
	after insertion of several equivalent elements.
	* testsuite/23_containers/unordered_multiset/insert/53115.cc: New.
	* testsuite/23_containers/unordered_multimap/insert/53115.cc: New.

From-SVN: r187025
2012-05-01 20:29:16 +00:00
Marc Glisse cf48c25519 re PR libstdc++/51795 (linear_congruential_engine doesn't work correctly)
2012-04-29  Marc Glisse  <marc.glisse@inria.fr>
	    Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/51795
	* include/bits/stl_algobase.h (__lg<>(_Size)): Remove.
	(__lg(int), __lg(unsigned), __lg(long), __lg(unsigned long),
	__lg(long long), __lg(unsigned long long)): Define constexpr.
	* include/bits/random.h (_Mod<>): Overcome Schrage's algorithm
	limitations.
	(__mod): Adjust.
	(linear_congruential): Remove FIXME static_assert.
	* include/bits/random.tcc (_Mod<>): Adjust.
	* testsuite/26_numerics/random/linear_congruential_engine/operators/
	51795.cc: New.

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

From-SVN: r186948
2012-04-29 23:36:09 +00:00
Jonathan Wakely 143a1ce16c functional (function::function(F)): LWG 2132: Disable constructor if argument isn't callable.
* include/std/functional (function::function(F)): LWG 2132: Disable
	constructor if argument isn't callable.
	* testsuite/20_util/function/cons/callable.cc: New.

From-SVN: r186947
2012-04-29 23:59:37 +01:00
Marc Glisse 1c8300874e re PR libstdc++/22200 (numeric_limits<signed>::is_modulo is inconsistent with gcc)
2012-04-29  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/22200
    	* include/std/limits (numeric_limits<>::is_modulo): False for
    	signed types.

From-SVN: r186944
2012-04-29 09:25:17 +00:00
Benjamin Kosnik af6204cc29 hashtable.h: Adjust doxygen markup for base classes.
2012-04-25  Benjamin Kosnik  <bkoz@redhat.com>

	*  include/bits/hashtable.h: Adjust doxygen markup for base classes.
	*  include/bits/hashtable_policy.h: Same.

From-SVN: r186856
2012-04-26 02:20:32 +00:00
Jonathan Wakely 862023d77a scoped_allocator (scoped_allocator::__outermost): Do not pass non-POD to varargs function.
* include/std/scoped_allocator (scoped_allocator::__outermost): Do
	not pass non-POD to varargs function.
	* testsuite/20_util/scoped_allocator/1.cc: Fix test.

From-SVN: r186836
2012-04-25 19:03:03 +01:00
Daniel Krugler 62fa805ffa type_traits (is_nothrow_destructible): Implement.
2012-04-23  Daniel Krugler  <daniel.kruegler@googlemail.com>

	* include/std/type_traits (is_nothrow_destructible): Implement.
	(is_destructible): Implement LWG 2049.
	* testsuite/util/testsuite_tr1.h: Add tests.
	* testsuite/20_util/is_nothrow_destructible/value.cc: New.
	* testsuite/20_util/is_nothrow_destructible/requirements/typedefs.cc:
	* testsuite/20_util/is_nothrow_destructible/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_destructible/value.cc: Adjust and extend.
	* testsuite/20_util/is_default_constructible/value.cc: Tweak.
	* testsuite/20_util/is_constructible/value-2.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: r186726
2012-04-23 21:34:06 +00:00
Paolo Carlini 9771644a91 re PR libstdc++/53080 (tuple interface to std::array doesn't check bounds)
2012-04-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/53080
	* include/std/array (tuple_element, get): static_assert I < N.
	* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
	New.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/tuple_element.cc: Fix.

From-SVN: r186702
2012-04-23 12:26:43 +00:00
Paolo Carlini 970aa0b9a9 re PR c++/53067 (c++0x GCC 4.7.0 Regression std::ref with unordered sets)
2012-04-22  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/53067
	* include/bits/hashtable_policy.h: Change inheritances to public.
	* testsuite/23_containers/unordered_map/requirements/53067.cc: New.
	* testsuite/23_containers/unordered_set/requirements/53067.cc: Likewise.

From-SVN: r186676
2012-04-22 17:37:57 +00:00
Jonathan Wakely 605aed299a alloc_traits.h (__alloc_traits::difference_type): Define.
* include/ext/alloc_traits.h (__alloc_traits::difference_type):
	Define.

From-SVN: r186673
2012-04-22 15:38:33 +01:00
Jonathan Wakely fcf6e948d1 ptr_traits.h (pointer_traits::rebind): Make public.
* include/bits/ptr_traits.h (pointer_traits::rebind): Make public.
	* testsuite/20_util/pointer_traits/requirements/typedefs.cc: Check
	rebind works.

From-SVN: r186670
2012-04-22 14:42:38 +01:00
Jonathan Wakely 7c688aded4 forward_list (forward_list::splice_after): Check allocators are equal.
* include/debug/forward_list (forward_list::splice_after): Check
	allocators are equal.
	* src/c++11/debug.cc: Fix spelling.
	* testsuite/23_containers/forward_list/debug/splice_after5_neg.cc:
	New.
	* testsuite/23_containers/forward_list/debug/splice_after6_neg.cc:
	Likewise.
	* testsuite/23_containers/forward_list/debug/splice_after7_neg.cc:
	Likewise.

From-SVN: r186669
2012-04-22 14:27:16 +01:00
Paolo Carlini b4989a1af9 re PR libstdc++/53052 ([C++11] is_explicitly_convertible still part of <type_traits> header)
2012-04-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/53052
	* include/std/type_traits (is_explicitly_convertible): Remove.
	* testsuite/20_util/is_explicitly_convertible: 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: r186617
2012-04-20 09:39:17 +00:00
Paolo Carlini 6a9ecd3492 re PR libstdc++/52702 ([C++11] std::is_trivially_destructible is missing)
2012-04-15  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/52702
	* include/std/type_traits (is_trivially_destructible): Add.
	(has_trivial_destructor): Remove.
	* testsuite/util/testsuite_common_types.h: Adjust.
	* testsuite/20_util/tuple/requirements/dr801.cc: Likewise.
	* testsuite/20_util/pair/requirements/dr801.cc: Likewise.
	* testsuite/20_util/is_trivially_destructible/value.cc: New.
	* testsuite/20_util/is_trivially_destructible/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/is_trivially_destructible/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: r186474
2012-04-15 23:35:27 +00:00
Paolo Carlini f84ca6e7ce re PR libstdc++/52699 (infinite loop generated with -O0)
2012-04-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/52699
	* include/bits/random.tcc (independent_bits_engine<>::operator()())
	Avoid various overflows; use common_type on result_type and
	_RandomNumberEngine::result_type; avoid floating point computations;
	other smaller tweaks.

	* include/bits/random.tcc (uniform_int_distribution<>::operator())
	Use common_type; assume _UniformRandomNumberGenerator::result_type
	unsigned; tidy.

	* include/bits/stl_algobase.h (__lg(unsigned), __lg(unsigned long),
	__lg(unsigned long long)): Add.

From-SVN: r186456
2012-04-14 22:33:22 +00:00
Paolo Carlini 079c74f3fc safe_iterator.h (_BeforeBeginHelper<>:: _S_Is_Beginnest): Add.
2012-04-13  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/debug/safe_iterator.h (_BeforeBeginHelper<>::
	_S_Is_Beginnest): Add.
	* include/debug/forward_list (_BeforeBeginHelper<>::
	_S_Is_Beginnest): Likewise.
	(_Safe_iterator<>::_M_is_beginnest): Add.
	* include/debug/safe_iterator.tcc (_Safe_iterator<>::_M_valid_range):
	Use the latter.
	* testsuite/23_containers/forward_list/debug/splice_after.cc:
	Add test.

From-SVN: r186411
2012-04-13 10:43:28 +00:00