Commit Graph

5239 Commits

Author SHA1 Message Date
Jonathan Wakely 3ecec1eff7 re PR libstdc++/56785 (std::tuple of two elements does not apply empty base class optimization when one of its elements is a std::tuple with two elements)
PR libstdc++/56785
	* include/std/tuple (_Tuple_impl): Remove zero-element specialization
	and define one-element specialization.
	* testsuite/20_util/tuple/56785.cc: New.

From-SVN: r219785
2015-01-17 00:21:41 +00:00
Jonathan Wakely 96d8c147aa locale_conv.h (wstring_convert, [...]): New.
* include/bits/locale_conv.h (wstring_convert, wbuffer_convert): New.
	* include/std/locale: Include new header.
	* include/Makefile.am: Add it.
	* include/Makefile.in: Regenerate.
	* testsuite/22_locale/conversions/buffer/requirements/typedefs.cc: New.
	* testsuite/22_locale/conversions/string/1.cc: New.
	* testsuite/22_locale/conversions/string/2.cc: New.
	* testsuite/22_locale/conversions/string/requirements/typedefs.cc: New.
	* testsuite/22_locale/conversions/string/requirements/typedefs-2.cc:
	New.

From-SVN: r219780
2015-01-16 23:38:48 +00:00
Jonathan Wakely 28af1fb39d Implement C++11 <codecvt> header.
* config/abi/pre/gnu.ver: Export new symbols.
	* include/Makefile.am: Add codecvt.
	* include/Makefile.in: Regenerate.
	* include/std/codecvt: New header.
	* src/c++11/codecvt.cc (__codecvt_utf8_base, __codecvt_utf16_base,
	__codecvt_utf8_utf16_base): Define specializations.
	* testsuite/22_locale/codecvt/codecvt_utf8/requirements/1.cc: New.
	* testsuite/22_locale/codecvt/codecvt_utf16/requirements/1.cc: New.
	* testsuite/22_locale/codecvt/codecvt_utf8_utf16/requirements/1.cc:
	New.

From-SVN: r219779
2015-01-16 23:38:35 +00:00
Torvald Riegel eae801bacc libstdc++: Optimize synchronization in std::future if futexes are available.
* src/c++11/futex.cc: New file.
	* include/bits/atomic_futex.h: New file.
	* include/std/future (__future_base::_State_baseV2): Use
	atomic_futex_unsigned instead of mutex+condvar.
	* src/c++11/futex.cc: Likewise.
	* include/Makefile.am: Add atomic_futex.h.
	* include/Makefile.in: Likewise.
	* src/c++11/Makefile.am: Add futex.cc.
	* src/c++11/Makefile.in: Likewise.

From-SVN: r219770
2015-01-16 19:50:43 +00:00
Jonathan Wakely bb93f35da1 acinclude.m4: Fix typo in comment.
* acinclude.m4: Fix typo in comment.
	* configure: Regenerate.
	* include/bits/codecvt.h (codecvt<char16_t, char, mbstate_t>,
	codecvt<char16_t, char, mbstate_t>): Declare specializations.
	* include/bits/locale_facets.h: Reserve space for new specializations.
	* src/c++11/Makefile.am: Add codecvt.cc.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/codecvt.cc: New.
	* src/c++98/Makefile.am: Compile locale_init.cc and localename.cc
	with -std=gnu++11.
	* src/c++98/Makefile.in: Regenerate.
	* src/c++98/locale_init.cc: Initialize new codecvt specializations.
	* src/c++98/localename.cc: Likewise.
	* config/abi/pre/gnu.ver: Exports for new codecvt specializations.
	* testsuite/22_locale/codecvt/utf8.cc: New.
	* testsuite/22_locale/locale/cons/unicode.cc: Check that new
	specializations are installed in locale objects.

From-SVN: r219747
2015-01-16 15:02:35 +00:00
Torvald Riegel 6220fdff17 libstdc++: Add POSIX variant of shared_timed_mutex.
* include/std/shared_mutex (shared_timed_mutex): Add POSIX-based
	implementation.

From-SVN: r219737
2015-01-16 13:22:00 +00:00
Jonathan Wakely 0edf5aadea re PR libstdc++/64476 (std::uninitialized_copy tests assignability the wrong way, resulting in performance pessimization)
PR libstdc++/64476
	* include/bits/stl_uninitialized.h (uninitialized_copy): Fix
	is_assignable arguments.
	* testsuite/20_util/specialized_algorithms/uninitialized_copy/64476.cc:
	New.

From-SVN: r219398
2015-01-09 18:02:47 +00:00
Tim Shen a8e67466d3 re PR libstdc++/64239 (regex_iterator::operator= should copy match_results::position)
PR libstdc++/64239
	* include/bits/regex.h (match_results<>::swap): Use std::swap
	instead of swap.
	* include/bits/regex_compiler.tcc (_Compiler<>::_M_quantifier):
	Likewise.
	* testsuite/28_regex/match_results/swap.cc: New testcase.

From-SVN: r219373
2015-01-09 03:58:59 +00:00
Jonathan Wakely c66b93fe20 re PR libstdc++/60132 (C++11: lack of is_trivially_copy_constructible)
PR libstdc++/60132
	* include/std/type_traits (has_trivial_default_constructor,
	has_trivial_copy_constructor, has_trivial_copy_assign): Add deprecated
	attribute.
	* testsuite/20_util/has_trivial_copy_assign/requirements/
	explicit_instantiation.cc: Use -Wno-deprecated.
	* testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/has_trivial_copy_assign/value.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/requirements/
	explicit_instantiation.c: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/value.cc:
	Likewise.
	* testsuite/20_util/pair/requirements/dr801.cc: Replace deprecated
	trait.
	* testsuite/20_util/tuple/requirements/dr801.cc: Likewise.
	* testsuite/util/testsuite_common_types.h: Likewise.

From-SVN: r219350
2015-01-08 16:24:55 +00:00
Jonathan Wakely ea0b599a91 * include/bits/hashtable_policy.h: Use __bool_constant.
From-SVN: r219343
2015-01-08 13:27:30 +00:00
Jakub Jelinek 5624e564d2 Update copyright years.
From-SVN: r219188
2015-01-05 13:33:28 +01:00
Tim Shen d0cbab5fed re PR libstdc++/64475 (FAIL: 28_regex/algorithms/regex_match/ecma/char/backref.cc)
PR libstdc++/64475
	* include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Copy the
	iterator, since the original one shouldn't be mutated.

From-SVN: r219151
2015-01-02 22:33:04 +00:00
Tim Shen ec5f010299 re PR libstdc++/64441 (A match_results returns an incorrect sub_match if the sub_match::matched is false)
PR libstdc++/64441
	* include/bits/regex.tcc (__regex_algo_impl): s/auto/auto&/.
	* include/bits/regex_executor.tcc (_Executor<>::_M_dfs): Likewise.

From-SVN: r219121
2014-12-31 10:27:41 +00:00
Paolo Carlini 59aa28e80f basic_string.h: Fix _S_local_capacity for large sizeof(_CharT).
2014-12-22  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/basic_string.h: Fix _S_local_capacity for
	large sizeof(_CharT).

From-SVN: r219031
2014-12-22 18:58:44 +00:00
Jonathan Wakely f37f5fb81c re PR libstdc++/37522 (Incorrect vswprintf prototype breaks __to_xstring)
PR libstdc++/37522
	* include/bits/basic_string.h (stod, stof, stoi, stol, stold, stoll,
	stoul, stoull, to_string): Only use _GLIBCXX_HAVE_BROKEN_VSWPRINTF
	to guard definition of to_wstring.
	* testsuite/21_strings/basic_string/numeric_conversions/char/dr1261.cc:
	Do not use dg-require-string-conversions.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stof.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stoi.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stol.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stold.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stoll.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/stoul.cc:
	Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/
	stoull.cc: Likewise.
	* testsuite/21_strings/basic_string/numeric_conversions/char/
	to_string.cc: Likewise.

From-SVN: r219019
2014-12-22 16:41:39 +00:00
Ville Voutilainen 8dff34fe8e re PR libstdc++/60271 ([DR2369] [C++1y] std::max(initializer_list<T>) cannot use std::max_element)
2014-12-22  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR libstdc++/60271
	C++14 constexpr min, max, minmax, min_element, max_element
	and minmax_element. Also constexpr for 20.9.5-20.9.9,
	aka various library functors.
	* include/bits/c++config: Add _GLIBCXX14_CONSTEXPR.
	* include/bits/algorithmfwd.h (min, max, minmax, min_element,
	max_element): Use it.
	* include/bits/predefined_ops.h (_Iter_less_iter, __iter_less_iter,
	_Iter_comp_iter, __iter_comp_iter): Likewise.
	* include/bits/stl_algo.h (minmax, __minmax_element, minmax_element,
	min, max, __min_element, min_element, __max_element, max_element)
	Likewise.
	* include/bits/stl_algobase.h (min, max): Likewise.
	* include/bits/stl_function.h (plus, minus, multiplies, divides,
	modulus, negate, equal_to, not_equal_to, greater, less, greater_equal,
	less_equal, logical_and, logical_or, logical_not, bit_and, bit_or,
	bit_xor, bit_not, unary_negate, not1, binary_negate, not2): Likewise.
	* testsuite/20_util/function_objects/constexpr.cc: New.
	* testsuite/25_algorithms/max/constexpr.cc: Likewise.
	* testsuite/25_algorithms/max_element/constexpr.cc: Likewise.
	* testsuite/25_algorithms/min/constexpr.cc: Likewise.
	* testsuite/25_algorithms/min_element/constexpr.cc: Likewise.
	* testsuite/25_algorithms/minmax/constexpr.cc: Likewise.
	* testsuite/25_algorithms/minmax_element/constexpr.cc: Likewise.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error.

From-SVN: r219015
2014-12-22 16:00:16 +00:00
Rüdiger Sonderfeld 0de0b10caa re PR libstdc++/54354 (TODO extended iomanip manipulators std::get_time and std::put_time (C++11, section 27.7.5))
2014-12-22  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>

	PR libstdc++/54354
	* include/std/iomanip (_Get_time): New struct.
	(get_time): New manipulator.
	(operator<<): New overloaded function.
	* testsuite/27_io/manipulators/extended/get_time/char/1.cc: New.
	* testsuite/27_io/manipulators/extended/get_time/char/2.cc: New.
	* testsuite/27_io/manipulators/extended/get_time/wchar_t/1.cc: New.
	* testsuite/27_io/manipulators/extended/get_time/wchar_t/2.cc: New.

From-SVN: r219013
2014-12-22 13:45:52 +00:00
Rüdiger Sonderfeld e869c0900c re PR libstdc++/60396 (Missing time_get<>::get() functions)
2014-12-22  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/60396
	* config/abi/pre/gnu.ver: Add new exports.
	* include/bits/locale_facets_nonio.h (time_get::get): New overloads.
	(time_get::do_get):  New virtual function.
	* include/bits/locale_facets_nonio.tcc (time_get::get): Define.
	(time_get::do_get): Define.
	* src/c++11/string-inst.cc (time_get::get, time_get::do_get): Add
	C++11-only instantiations.
	* testsuite/22_locale/time_get/get/char/1.cc: New.
	* testsuite/22_locale/time_get/get/char/2.cc: New.
	* testsuite/22_locale/time_get/get/wchar_t/1.cc: New.
	* testsuite/22_locale/time_get/get/wchar_t/2.cc: New.

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

From-SVN: r219012
2014-12-22 13:45:44 +00:00
Jonathan Wakely 8b6425215f re PR libstdc++/64367 (g++-v5/stdexcept:52:28: error: invalid use of non-static data member '_M_p')
PR libstdc++/64367
	* include/std/stdexcept: Don't use non-static member in sizeof.

From-SVN: r218997
2014-12-21 15:16:08 +00:00
François Dumont a5ebfd3e2a vector (std::__debug::vector<>::clear()): Do not reset guaranteed capacity.
2014-12-20  François Dumont  <fdumont@gcc.gnu.org>

	* include/debug/vector (std::__debug::vector<>::clear()): Do not reset
	guaranteed capacity.
	* testsuite/23_containers/vector/bool/allocator/swap.cc: Move
	propagating_allocator equality and inequality operators to __gnu_test
	namespace.

From-SVN: r218991
2014-12-20 19:16:03 +00:00
François Dumont 9836f82e7a c++config: inline __cxx11 namespace within namespace __cxx1998.
2014-12-20  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/c++config: inline __cxx11 namespace within namespace
	__cxx1998.

From-SVN: r218988
2014-12-20 08:37:02 +00:00
Jonathan Wakely 34a2b7558b New std::string implementation.
* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_CXX11_ABI): Remove.
	(GLIBCXX_ENABLE_LIBSTDCXX_DUAL_ABI, GLIBCXX_DEFAULT_ABI): Add.
	* configure.ac: Use new macros.
	* configure: Regenerate.
	* Makefile.in: Regenerate.
	* doc/Makefile.in: Regenerate.
	* libsupc++/Makefile.in: Regenerate.
	* po/Makefile.in: Regenerate.
	* src/Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.
	* include/Makefile.am: Set _GLIBCXX_USE_DUAL_ABI.
	* include/Makefile.in: Regenerate.
	* config/abi/pre/gnu.ver: Export symbols related to new std::string.
	Tighten old patterns to not match new symbols.
	* config/locale/generic/monetary_members.cc: Guard some definitions
	to not compile with new ABI.
	* config/locale/gnu/monetary_members.cc: Likewise.
	* config/locale/gnu/numeric_members.cc: Prevent double-free.
	* config/os/gnu-linux/ldbl-extra.ver: Add new __gnu_cxx_ldbl128
	exports. Tighten old patterns.
	* doc/xml/manual/configure.xml: Document new configure options.
	* doc/html/*: Regenerate.
	* include/bits/basic_string.h (__cxx11::basic_string): Define new
	non-reference-counted implementation in inline namespace __cxx11.
	(stoi, stol, stoll, stof, stod, stold, to_string): Conditionally use
	inline namespace.
	(literals::string_literals::operator"): Conditionally use abi-tag.
	* include/bits/basic_string.tcc (__cxx11::basic_string): Define.
	* include/bits/c++config: Define _GLIBCXX_USE_DUAL_ABI and
	LDBL_CXX11_ABI namespace macros.
	* include/bits/locale_classes.h (locale::name()): Use abi_tag when
	new ABI is in use.
	(locale::_S_twinned_facets): New static member.
	(locale::facet::__shim): Declare new type.
	(locale::_facet::_M_sso_shim, locale::_facet::_M_cow_shim): New
	functions for creating shims.
	(locale::_Impl::_M_facet_unchecked): New member function for use
	during construction.
	(locale::_Impl::_M_init_extra): New member functions to create second
	version of some facets.
	(collate, collate_byname): Use abi_tag when new ABI is in use.
	* include/bits/locale_facets.h: Add _GLIBCXX_NUM_CXX11_FACETS macro.
	(numpunct, numpunct_byname): Use __cxx11 namespace.
	(num_get::_M_extract_float, num_get::_M_extract_int): Use abi_tag
	when new ABI is in use.
	(num_get::__do_get, num_put::__do_put): Do not declare long double
	compat functions for new ABI.
	* include/bits/locale_facets.tcc (num_get, num_put): Use abi_tag on
	definitions.
	(numpunct, numpunct_byname): Qualify explicit instantiations.
	* include/bits/locale_facets_nonio.h (time_get, time_get_byname,
	moneypunct, moneypunct_byname, money_get, money_put, messages,
	messages_byname): Use new inline namespace macros.
	(money_get::__do_get, money_put::__do_put): Do not declare long
	double compat functions for new ABI.
	* include/bits/locale_facets_nonio.tcc (money_get, money_put): Use
	new namespace macros.
	(money_get::__do_get, money_put::__do_put): Do not define for new ABI.
	* include/bits/localefwd.h (numpunct, numpunct_byname, collate,
	collate_byname, time_get, time_get_byname, moneypunct,
	moneypunct_byname, money_get, money_put, messages, messages_byname):
	Use new namespace macros.
	* include/bits/regex.h: Use inline namespace macros.
	* include/bits/stl_list.h (_List_base, list): Use inline namespace
	instead of abi-tag.
	* include/bits/stringfwd.h (basic_string): Use namespace macros.
	* include/std/iosfwd (basic_stringbuf, basic_istringstream,
	basic_ostringstream, basic_stringstream): Likewise.
	* include/std/sstream: Likewise.
	(basic_stringbuf::__xfer_bufptrs): Update streambuf pointers on move.
	* include/std/stdexcept (__cow_string, __sso_string): New types for
	indirectly using std::string with either ABI.
	(logic_error, runtime_error): Replace std::string member with
	__cow_string when new ABI is in use. Declare non-inline copy
	constructor and assignment operator. Declare const char* constructors.
	(domain_error, invalid_argument, length_error, out_of_range,
	range_error, overflow_error, underflow_error): Declare const char*
	constructors.
	* include/std/system_error (error_category): Replace with new
	definition in inline namespace _V2.
	(error_code::message, error_condition::message): Use abi_tag on
	functions returning std::string.
	* python/libstdcxx/v6/printers.py (StdStringPrinter): Handle new ABI.
	* src/c++11/Makefile.am: Add new files.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/compatibility-c++0x.cc: Compile with old std::string ABI.
	Define old error_category symbols.
	* src/c++11/cow-fstream-inst.cc: New. Instantiate fstream members
	using old std::string ABI.
	* src/c++11/cow-locale_init.cc (locale::_Impl::_M_init_extra): Define.
	* src/c++11/cow-shim_facets.cc: Define shim facets using old ABI.
	* src/c++11/cow-sstream-inst.cc: Instantiate stringstreams using old
	std::string ABI.
	* src/c++11/cow-stdexcept.cc: Define new constructors and assignment
	operators.
	(__cow_string, error_category::_M_message): Define.
	* src/c++11/cow-string-inst.cc: Explicit instantiations using old
	std::string. Include src/c++98/istream-string.cc.
	* src/c++11/cow-wstring-inst.cc: Explicit instantiations using old
	std::wstring.
	* src/c++11/cxx11-hash_tr1.cc: Explicit instantiations using new
	string.
	* src/c++11/cxx11-ios_failure.cc: Add sanity check.
	* src/c++11/cxx11-locale-inst.cc: Instantiate facets using new
	std::string.
	* src/c++11/cxx11-shim_facets.cc: Define shim facets using new ABI.
	* src/c++11/cxx11-stdexcept.cc: Define constructors taking new
	std::string.
	* src/c++11/cxx11-wlocale-inst.cc: Instantiate facets using
	new std::wstring.
	* src/c++11/fstream-inst.cc: Compile with new ABI.
	* src/c++11/functexcept.cc: Compile with old ABI.
	* src/c++11/random.cc: Compile with new ABI.
	* src/c++11/sstream-inst.cc: Compile with new ABI.
	* src/c++11/string-inst.cc: Explicit instantiations for new string.
	* src/c++11/system_error.cc (__sso_string, error_category::_M_message):
	Define.
	* src/c++11/wstring-inst.cc: Compile with new ABI.
	* src/c++98/Makefile.am: Compile some host files twice for old and
	new std::string. Add new files.
	* src/c++98/Makefile.in: Regenerate.
	* src/c++98/compatibility-ldbl.cc: Compile with old ABI.
	* src/c++98/compatibility.cc: Likewise.
	* src/c++98/concept-inst.cc: Likewise.
	* src/c++98/hash_tr1.cc: Likewise.
	* src/c++98/istream-string.cc: New file defining functions that
	work with istream and std::string moved from ...
	* src/c++98/istream.cc: ... here.
	* src/c++98/cow-istream-string.cc: Recompile istream-string.cc with
	old ABI.
	* src/c++98/locale-inst.cc: Adjust facet instantiations to work for
	either ABI.
	* src/c++98/locale.cc (locale::_M_install_facet,
	locale::_M_install_cache): Handle twinned facets.
	* src/c++98/locale-facets.cc: Compile with old std::string ABI.
	(__verify_grouping): Define new overload and old std::string version.
	* src/c++98/locale_init.cc: Initialize twinned facets.
	* src/c++98/localename.cc: Likewise.
	* src/c++98/misc-inst.cc: Instantiate C++98-only std::string members.
	(__verify_grouping): Define new std::string version.
	* src/c++98/stdexcept.cc: Compile with old std::string ABI.
	* src/c++98/wlocale-inst.cc: Likewise.
	* testsuite/18_support/50594.cc: Adjust to work with SSO strings.
	* testsuite/21_strings/basic_string/capacity/1.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/1.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/18654.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/char/2.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/wchar_t/1.cc: Likewise.
	* testsuite/21_strings/basic_string/capacity/wchar_t/18654.cc:
	Likewise.
	* testsuite/21_strings/headers/string/synopsis.cc: Use inline
	namespace macros.
	* testsuite/23_containers/headers/list/synopsis.cc: Likewise.
	* testsuite/27_io/basic_ios/copyfmt/char/1.cc: Set dg-options so
	correct exception type can be caught.
	* testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/char/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/
	exceptions_failbit.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/extractors_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise.
	* testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/char/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/basic_ostream/inserters_other/wchar_t/
	exceptions_null.cc: Likewise.
	* testsuite/27_io/ios_base/storage/2.cc: Likewise.
	* testsuite/27_io/ios_base/failure/cxx11.cc: Disable for old ABI.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error.
	* testsuite/libstdc++-prettyprinters/libfundts.cc: Use old ABI.
	* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
	* testsuite/libstdc++-prettyprinters/whatis.cc: Likewise.
	* testsuite/util/exception/safety.h: Adjust member function types
	for new std::string.
	* testsuite/util/testsuite_abi.cc: Add new version and ignore
	__float128 symbols in __cxx11 namespace.

From-SVN: r218964
2014-12-19 18:16:39 +00:00
Tim Shen e16a69a8f2 re PR libstdc++/64302 (The match_results::cbegin()/cend() return incorrect results)
PR libstdc++/64302
	PR libstdc++/64303
	* include/bits/regex.h (match_results::cbegin, match_results::cend,
	regex_token_iterator::regex_token_iterator,
	regex_token_iterator::_M_normalize_result): Fix match_results cbegin
	and cend and regex_token_iterator::_M_result invariant.
	* include/bits/regex.tcc: Fix regex_token_iterator::_M_result invariant.
	* testsuite/28_regex/iterators/regex_token_iterator/64303.cc: Testcase.

From-SVN: r218810
2014-12-17 09:25:44 +00:00
Tim Shen bc2738455b re PR libstdc++/64239 (regex_iterator::operator= should copy match_results::position)
PR libstdc++/64239
	* include/bits/regex.h (match_results<>::match_results,
	match_results<>::operator=, match_results<>::position,
	match_results<>::swap): Remove match_results::_M_in_iterator.
	Fix ctor/assign/swap.
	* include/bits/regex.tcc: (__regex_algo_impl<>,
	regex_iterator<>::operator++): Set match_results::_M_begin as
	"start position".
	* testsuite/28_regex/iterators/regex_iterator/char/
	string_position_01.cc: Test cases.

From-SVN: r218710
2014-12-13 22:19:18 +00:00
Jonathan Wakely 6554581713 Post-Urbana updates to Library Fundamentals v1.
* include/experimental/any (any): Remove allocator support and update
	feature-testing macro.
	* include/experimental/functional: Update feature-testing macro.
	* include/experimental/optional (optional::_M_get()): Add constexpr.
	(optional::operator*(), optional::value()): Overload and add
	ref-qualifiers. Update feature-testing macro.
	* include/experimental/string_view (basic_string_view::clear): Remove
	and update feature-testing macro.
	* testsuite/experimental/any/cons/3.cc: Remove.
	* testsuite/experimental/any/cons/4.cc: Remove.
	* testsuite/experimental/any/misc/any_cast.cc: Remove allocator tests.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.
	* testsuite/experimental/string_view/capacity/1.cc: Don't test clear().

From-SVN: r218709
2014-12-13 20:44:06 +00:00
Jonathan Wakely 93889749df re PR libstdc++/58594 (std::make_shared does not accept const types as parameters)
PR libstdc++/58594
	* include/bits/shared_ptr_base.h: Real fix for cv-qualified types.

From-SVN: r218698
2014-12-13 00:44:17 +00:00
Jonathan Wakely d95521b411 re PR libstdc++/58594 (std::make_shared does not accept const types as parameters)
PR libstdc++/58594
	* include/bits/shared_ptr_base.h: Cast away cv-quals.
	* testsuite/20_util/shared_ptr/creation/58594-no-rtti.cc: New.
	* testsuite/20_util/shared_ptr/creation/private.cc: Make allocator
	rebindable so test passes with -fno-rtti.

From-SVN: r218691
2014-12-12 21:05:35 +00:00
Jonathan Wakely 0f3d27f01a re PR libstdc++/64276 (would be better to use __cpp_exceptions rather than __EXCEPTIONS to determine whether exceptions are available)
PR libstdc++/64276
	* doc/doxygen/user.cfg.in: Define __cpp_exceptions and __cpp_rtti.
	* doc/html/manual/using_exceptions.html: Regenerate.
	* doc/xml/manual/using_exceptions.xml: Use SD-6 feature-testing
	macros, __cpp_exceptions and __cpp_rtti, instead of __EXCEPTIONS and
	__GXX_RTTI.
	* include/bits/c++config: Likewise.
	* include/bits/locale_classes.tcc: Likewise.
	* include/bits/shared_ptr.h: Likewise.
	* include/bits/shared_ptr_base.h: Likewise.
	* include/debug/formatter.h: Likewise.
	* include/experimental/any: Likewise.
	* include/ext/rope: Likewise.
	* include/ext/ropeimpl.h: Likewise.
	* include/std/functional: Likewise.
	* include/tr1/functional: Likewise.
	* include/tr1/shared_ptr.h: Likewise.
	* libsupc++/eh_call.cc: Likewise.
	* libsupc++/eh_personality.cc: Likewise.
	* libsupc++/exception_defines.h: Likewise.
	* libsupc++/exception_ptr.h: Likewise.
	* libsupc++/guard.cc: Likewise.
	* libsupc++/pbase_type_info.cc: Likewise.
	* libsupc++/pointer_type_info.cc: Likewise.
	* libsupc++/vterminate.cc: Likewise.
	* src/c++11/thread.cc: Likewise.

From-SVN: r218679
2014-12-12 15:58:49 +00:00
Jonathan Wakely db62401dee stl_iterator.h (make_reverse_iterator): LWG DR 2285.
* include/bits/stl_iterator.h (make_reverse_iterator): LWG DR 2285.
	* include/std/tuple: Add feature-test macro.
	* testsuite/24_iterators/reverse_iterator/make.cc: New.

From-SVN: r218670
2014-12-12 13:35:55 +00:00
Jonathan Wakely 6789ccfa46 Implement LWG DR 2329 and DR 2332.
* include/bits/regex.h (regex_match, regex_search): LWG DR 2329,
	add deleted overloads for rvalue strings.
	(regex_iterator, regex_token_iterator): LWG DR 2332, add deleted
	constructors for rvalue regexes.
	* testsuite/28_regex/algorithms/regex_match/dr2329_neg.cc: New.
	* testsuite/28_regex/algorithms/regex_search/dr2329_neg.cc: New.
	* testsuite/28_regex/iterators/regex_iterator/ctors/char/dr2332_neg.cc:
	New.
	* testsuite/28_regex/iterators/regex_token_iterator/ctors/char/
	dr2332_neg.cc: New.

From-SVN: r218555
2014-12-10 01:37:37 +00:00
Jonathan Wakely 9131b50960 future (__future_base::_Setter::operator(), [...]): Make call operators const.
* include/std/future (__future_base::_Setter::operator(),
	__future_base::_Task_setter::operator()): Make call operators const.

From-SVN: r218553
2014-12-10 00:39:37 +00:00
Jonathan Wakely d6f64424aa locale_facets.tcc (numpunct::_M_cache): Avoid calling virtual functions twice.
* include/bits/locale_facets.tcc (numpunct::_M_cache): Avoid calling
	virtual functions twice. Only update _M_allocated after all
	allocations have succeeded.
	* include/bits/locale_facets_nonio.tcc (moneypunct::_M_cache):
	Likewise.
	* include/bits/locale_facets_nonio.h (__timepunct::_M_cache): Remove
	unused declaration.

From-SVN: r218552
2014-12-10 00:21:37 +00:00
Jonathan Wakely 60b6534a84 re PR libstdc++/64203 (shared_mutex compile errors on bare-metal targets)
PR libstdc++/64203
	* include/std/shared_mutex: Fix preprocessor conditions.
	* testsuite/experimental/feat-cxx14.cc: Check conditions.

From-SVN: r218511
2014-12-09 11:03:57 +00:00
Jonathan Wakely 612b47110a hashtable_policy.h (_Map_base::operator[], [...]): Simplify definitions with trailing return types.
* include/bits/hashtable_policy.h (_Map_base::operator[],
	_Map_base::at): Simplify definitions with trailing return types.

From-SVN: r218416
2014-12-05 10:35:51 +00:00
Tim Shen 9b9c2a974a re PR libstdc++/64140 (match_results.prefix() returns an incorrect result if regex_iterator holds a zero-length match)
PR libstdc++/64140
	* include/bits/regex.tcc (regex_iterator<>::operator++): Update
	prefix.matched after modifying prefix.first.
	* testsuite/28_regex/iterators/regex_iterator/char/64140.cc: New
	testcase.

From-SVN: r218340
2014-12-04 04:25:12 +00:00
François Dumont d31008d7a0 re PR libstdc++/13631 (Problems in messages)
2014-12-03  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/13631
	* include/bits/codecvt.h (codecvt<char, char, mbstate_t>): friend class
	std::messages<char>.
	(codecvt<wchar_t, char, mbstate_t>): friend class
	std::messages<wchar_t>.
	* config/locale/gnu/messages_member.h
	(messages<char>::do_open): Specialized.
	(messages<char>::do_close): Likewise.
	(messages<wchar_t>::do_open): Likewise.
	(messages<wchar_t>::do_close): Likewise.
	* config/locale/gnu/messages_member.cc:
	(messages<char>::do_open): Implement. Use bind_textdomain_codeset based
	on codecvt<char, char, mbstate_t>._M_c_locale_codecvt code set. Use
	internal cache to keep opened domain name with locale information.
	(messages<wchar_t>::do_open): Likewise with
	codecvt<wchar_t, char, mbstate_t>.
	(messages<char>::do_close): Implement. Clean cache information.
	(messages<wchar_t>::do_close): Likewise.
	(get_glibc_msg): New. Use dgettext rather than gettext using cached
	domain name associated to catalog id.
	(messages<char>::do_get): Use latter.
	(messages<wchar_t>::do_get): Likewise and use also cached locale
	codecvt<wchar_t, char, mbstate_t> facet to convert wchar_t default
	value to char and the result back to wchar_t.
	* testsuite/22_locale/messages/13631.cc: New.
	* testsuite/22_locale/messages/members/char/2.cc: Use also fr_FR locale
	for charset conversion to get the expected accented character.

From-SVN: r218329
2014-12-03 19:47:00 +00:00
Marek Polacek 028c9c9ed7 regex_compiler.h (_S_cache_size): Multiply the RHS of the shift-expression by _UseCache::value.
* include/bits/regex_compiler.h (_S_cache_size): Multiply the
	RHS of the shift-expression by _UseCache::value.

From-SVN: r218322
2014-12-03 16:16:33 +00:00
Jonathan Wakely 103265d611 re PR libstdc++/64168 (FAIL: 30_threads/async/sync.cc execution test)
PR libstdc++/64168
	* include/std/future (_Deferred_state::_M_has_deferred): Fix return.

From-SVN: r218321
2014-12-03 16:09:21 +00:00
Jonathan Wakely db97b3b018 hashtable.h: Fix whitespace and simplify function definitions with trailing return types.
* include/bits/hashtable.h: Fix whitespace and simplify function
	definitions with trailing return types.

From-SVN: r218309
2014-12-03 12:00:02 +00:00
Jonathan Wakely 9db7c9316e Define *_at_thread_exit() functions.
* config/abi/pre/gnu.ver: Add new exports.
	* include/std/condition_variable (notify_all_at_thread_exit): Declare.
	(__at_thread_exit_elt): New base class.
	* include/std/future: Add comments documenting the implementation.
	(__future_base::_State_baseV2::_State_baseV2()): Use brace-or-equal
	initializers and define constructor as defaulted.
	(__future_base::_State_baseV2::_M_ready): Replace member function
	with member variable.
	(__future_base::_State_baseV2::_M_set_result): Set _M_ready.
	(__future_base::_State_baseV2::_M_set_delayed_result): Define.
	(__future_base::_State_baseV2::_M_break_promise): Set _M_ready.
	(__future_base::_State_baseV2::_Make_ready): New helper class.
	(__future_base::_Deferred_state::_M_has_deferred): Remove requirement
	for caller to own mutex.
	(__future_base::_Async_state_impl::~_Async_state_impl): Call join
	directly.
	(__future_base::_Task_state_base::_M_run): Take arguments by
	reference.
	(__future_base::_Task_state_base::_M_run_delayed): Declare new pure
	virtual function.
	(__future_base::_Task_state::_M_run_delayed): Define override.
	(promise::set_value_at_thread_exit): Define.
	(promise::set_exception_at_thread_exit): Define.
	(packaged_task::make_ready_at_thread_exit): Define.
	* src/c++11/condition_variable.cc (notify_all_at_thread_exit): Define.
	* src/c++11/future.cc
	(__future_base::_State_baseV2::_Make_ready::_M_set): Define.
	* testsuite/30_threads/condition_variable/members/3.cc: New.
	* testsuite/30_threads/packaged_task/members/at_thread_exit.cc: New.
	* testsuite/30_threads/promise/members/at_thread_exit.cc: New.

From-SVN: r218255
2014-12-02 01:51:25 +00:00
Jonathan Wakely 7b55fa54d4 re PR libstdc++/63840 (std::function copy constructor deletes an uninitialized pointer if new fails)
PR libstdc++/63840
	* include/std/functional (function::function(const function&)): Set
	_M_manager after operations that might throw.
	* include/tr1/functional (function::function(const function&),
	function::function(_Functor, _Useless)): Likewise.
	* testsuite/20_util/function/63840.cc: New.
	* testsuite/tr1/3_function_objects/function/63840.cc: New.

From-SVN: r218215
2014-12-01 13:49:20 +00:00
Jonathan Wakely bd6757b8d3 nonio.h (__timepunct): Remove unused typedef.
* include/bits/locale_facets/nonio.h (__timepunct): Remove unused
	typedef.
	(time_get): Likewise. Fix comments.

From-SVN: r218183
2014-11-29 22:58:33 +00:00
Tim Shen 02ba3fc22d re PR libstdc++/63920 (Any regular expression should not match an empty sequence if match_not_null is specified)
PR libstdc++/63920
	* include/bits/regex_executor.h: Make _M_begin non const.
	* include/bits/regex_executor.tcc (_Executor<>::_M_search): Increase
	_M_begin in search algorithm, so that _M_begin is treated as
	"current start position" for each search iteration.
	* testsuite/28_regex/algorithms/regex_search/ecma/flags.cc: New
	testcase.

From-SVN: r218037
2014-11-25 05:43:04 +00:00
Jason Merrill 5f7282e2cb re PR c++/33911 (attribute deprecated vs. templates)
PR c++/33911
gcc/cp/
	* call.c (build_call_a): Don't warn_deprecated_use here.
	(build_over_call): Or here.
	* decl2.c (mark_used): Do it here.
	(is_late_template_attribute): Attribute deprecated is not deferred.
	(cplus_decl_attributes): Propagate TREE_DEPRECATED out to the template.
	* parser.c (cp_parser_template_name): Warn about deprecated template.
	(cp_parser_template_argument): Likewise.
libstdc++-v3/
	* include/backward/binders.h: Suppress -Wdeprecated-declarations.
	* include/ext/array_allocator.h: Likewise.

From-SVN: r217677
2014-11-17 17:09:27 -05:00
Jonathan Wakely a5dde6ddac Define C++11 version of std::ios_base::failure.
* config/abi/pre/gnu.ver: Add new exports.
	* include/bits/ios_base.h (ios_base::failure): New definition using
	abi_tag.
	(io_errc, make_error_code, make_error_category, iostream_category):
	Define.
	* include/std/system_error (system_error): Add char* constructors.
	* src/c++11/Makefile.am: Add new file.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/cxx11-ios_failure.cc: New file.
	* src/c++98/ios_failure.cc: Compile old definition without abi_tag.
	* testsuite/27_io/ios_base/failure/cxx11.cc: New.
	* testsuite/27_io/ios_base/failure/what-1.cc: Allow string returned by
	ios_base::failure::what() to contain additional data.
	* testsuite/27_io/ios_base/failure/what-2.cc: Likewise..
	* testsuite/27_io/ios_base/failure/what-3.cc: Likewise..
	* testsuite/27_io/ios_base/failure/what-big.cc: Likewise..

From-SVN: r217559
2014-11-14 12:17:57 +00:00
Daniel Kruegler b82e9b016f regex.h: Support embedded zeros in sub_match comparisons (DR 2217)
2014-11-13  Daniel Kruegler  <daniel.kruegler@gmail.com>

	* include/bits/regex.h: Support embedded zeros in sub_match
	comparisons (DR 2217)
	* testsuite/28_regex/sub_match/embedded_zeros_cmp.cc:
	Add test cases for embedded zeros

From-SVN: r217535
2014-11-14 04:23:06 +00:00
Tim Shen 79b576cc38 re PR libstdc++/63775 ([C++11] Regex range with leading dash (-) not working)
PR libstdc++/63775
	* include/bits/regex_compiler.h (_Compiler<>::_M_expression_term,
	_BracketMatcher<>::_M_make_range): Throw regex_erorr on invalid range
	like [z-a]. Change _M_expression_term interface.
	* include/bits/regex_compiler.tcc (
	_Compiler<>::_M_insert_bracket_matcher,
	_Compiler<>::_M_expression_term): Rewrite bracket expression parsing.
	* testsuite/28_regex/algorithms/regex_match/cstring_bracket_01.cc:
	Add testcases and move file out of extended.

From-SVN: r217461
2014-11-13 07:40:01 +00:00
Jonathan Wakely be8de8946e std::shared_ptr atomic operations
PR libstdc++/57250
	* config/abi/pre/gnu.ver: Export new symbols.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/shared_ptr_atomic.h: Define atomic access functions.
	* include/std/memory: Include new header.
	* src/c++11/shared_ptr.cc (_Sp_locker): Define and use mutex pool.
	* testsuite/20_util/shared_ptr/atomic/1.cc: New.
	* testsuite/20_util/shared_ptr/atomic/2.cc: New.
	* testsuite/20_util/shared_ptr/atomic/3.cc: New.

From-SVN: r217452
2014-11-12 23:55:11 +00:00
Jonathan Wakely d8af84e67b Implement resolutions of LWG 2399, 2400 and 2401.
* include/bits/shared_ptr.h (shared_ptr, weak_ptr): Define
	_Convertible alias template to simplify constraints.
	(shared_ptr(unique_ptr<TD>&&)): Constrain (LWG 2399).
	* include/bits/shared_ptr_base.h: Likewise.
	(_Sp_counted_deleter::_M_get_deleter()): Use addressof (LWG 2400).
	* include/std/functional (function::operator=(nullptr_t)): Add
	noexcept (LWG 2401).
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Adjust dg-error.

From-SVN: r217442
2014-11-12 19:41:36 +00:00
Jonathan Wakely f871d7f9f4 LWG DR 2315. weak_ptr should be movable
* include/bits/shared_ptr.h (weak_ptr): Add move constructor and
	assignment.
	* include/bits/shared_ptr_base.h (__weak_count, __weak_ptr): Likewise.
	Use nullptr and injected class name.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Adjust dg-error.

From-SVN: r217413
2014-11-12 11:54:08 +00:00
Jonathan Wakely 72e58f18ae optional (_Has_addressof): Check for non-member operator&.
* include/experimental/optional (_Has_addressof): Check for non-member
	operator&.
	* testsuite/experimental/optional/observers/2.cc: Add operator&.
	* testsuite/experimental/optional/constexpr/observers/2.cc: Likewise.

From-SVN: r217397
2014-11-12 00:16:19 +00:00
Jonathan Wakely 847e9cf81e Define __void_t and SFINAE-friendly iterator_traits.
* include/std/type_traits (__void_t): Define new alias template.
	(_GLIBCXX_HAS_NESTED_TYPE): Redefine using __void_t.
	* include/std/functional (_Maybe_get_result_type): Likewise.
	* include/bits/stl_iterator_base_types.h (__iterator_traits): Likewise.
	* include/bits/uses_allocator.h (__uses_allocator_helper): Likewise.
	* testsuite/20_util/bind/ref_neg.cc: Adjust dg-error.
	* testsuite/20_util/reference_wrapper/typedefs-3.cc: Adjust to changes
	in _GLIBCXX_HAS_NESTED_TYPE.

From-SVN: r217395
2014-11-11 23:57:35 +00:00
Jonathan Wakely f6b640be24 Make std::mem_fn work with varargs functions.
* include/std/functional (_Mem_fn_traits): Add partial specializations
	for varargs functions.
	(_Mem_fn_base): Do not check arguments are convertible for varargs.
	(_Bind_check_arity): Add partial specializations for varargs functions.
	* include/std/type_traits (__bool_constant): Add alias template.
	* testsuite/20_util/bind/ref_neg.cc: Adjust dg-error.
	* testsuite/20_util/bind/refqual.cc: New, test ref-qualifiers.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error.
	* testsuite/20_util/function_objects/mem_fn/refqual.cc: Test varargs.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
	dg-error.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Adjust
	dg-error.

From-SVN: r217393
2014-11-11 23:38:34 +00:00
François Dumont 970a9caa49 re PR libstdc++/61107 (stl_algo.h: std::__inplace_stable_partition() doesn't process the whole data range)
2014-11-11  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/61107
	* include/bits/stl_algo.h (__inplace_stable_partition): Delete.
	(__stable_partition_adaptive): Return __first if range length is 1.
	(__stable_partition): Adapt.
	* testsuite/util/testsuite_new_operators.h: New.
	* testsuite/25_algorithms/stable_sort/1.cc: Test algo in simulated
	constraint memory context.
	* testsuite/25_algorithms/inplace_merge/1.cc: Likewise.
	* testsuite/25_algorithms/stable_partition/1.cc: Likewise.

From-SVN: r217370
2014-11-11 21:21:10 +00:00
Jonathan Wakely e9c51193ea re PR libstdc++/63811 (r217322 breaks bootstrap)
PR libstdc++/63811
	* include/bits/stl_deque.h (_Deque_base::_M_move_impl()): Avoid using
	badname.

From-SVN: r217343
2014-11-11 10:41:46 +00:00
Jonathan Wakely 2abd4ee6b5 Fix std::deque move construction with non-equal allocators.
* include/bits/stl_deque.h (_Deque_base::_Deque_base(_Deque_base&&)):
	Dispatch according to whether allocators are always equal.
	(_Deque_base::_M_move_impl()): Implement move-from state.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Fix
	dg-error line number.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r217322
2014-11-10 22:44:07 +00:00
François Dumont b12db70880 Major maintenance patch of the profile mode.
2014-11-10  François Dumont  <fdumont@gcc.gnu.org>

	Major maintenance patch of the profile mode.
	* include/profile/impl/profiler_container_size.h
	(__container_size_info()): Delete.
	(__container_size_info(const __container_size_info&)): Delete.
	(virtual ~__container_size_info()): Delete.
	(__container_size_info(__stack_t, size_t)): Delete.
	(__container_size_info(__stack_t)): New.
	(__container_size_info::__init(size_t)): New.
	(__container_size_info::__merge): Call __object_info_base::__merge.
	(__trace_container_size::__construct): Delete declaration.
	(__trace_container_size::__insert): Return __container_size_info*,
	call __init.
	* include/profile/impl/profiler_hash_func.h
	(__hashfunc_into()): Delete.
	(__hashfunc_info(const __hashfunc_info&)): Delete.
	(virtual ~__hashfunc_info()): Delete.
	(__hashfunc_info::__merge): Call __object_info_base::__merge.
	(__trace_hash_func::__insert): Delete.
	(__trace_hash_func_free): New.
	(__trace_hash_func_report): Call __trace_report.
	(__trace_hash_func_construct): Return __hashfunc_info*. Add check for
	reentrancy.
	* include/profile/impl/profiler_hashtable_size.h
	(__trace_hashtable_size_free): New.
	(__trace_hashtable_size_report): Call __trace_report.
	(__trace_hashtable_size_construct): Return __container_size_info*. Add
	check for reentrancy.
	* include/profile/impl/profiler_list_to_slist.h
	(__list2slist_info()): Delete.
	(__list2slist_info(const __list2slist_info&)): Delete.
	(virtual ~__list2slist_info()): Delete.
	(__trace_list_to_slist::__merge(const __list2slist_info&)): Delete.
	(__trace_list_to_slist::__opr_rewind(const void*)): Delete.
	(__trace_list_to_slist::__record_operation(const void*)): Delete.
	(__trace_list_to_slist::__insert(const __object_t, __stack_t)): Delete.
	(__trace_list_to_slist::__destruct): Only call __retire_object.
	(__trace_list_to_slist_free()): New.
	(__trace_list_to_slist_report): Call __trace_report.
	(__trace_list_to_slist_construct): Return __list2slist_info*. Add check
	for reentrancy.
	* include/profile/impl/profiler_list_to_vector.h
	(__list2vector_info()): Delete.
	(__list2vector_info(const __list2vector_info&)): Delete.
	(virtual ~__list2vector_info()): Delete.
	(_list2vector_info::__is_valid): Delete.
	(_list2vector_info::__set_invalid): Delete.
	(_list2vector_info::__opr_iterate): Use atomic operation.
	(_list2vector_info::_M_valid): Delete.
	(__trace_list_to_vector::__insert): Delete.
	(__trace_list_to_vector::__find): Delete.
	(__trace_list_to_vector::__opr_insert): Delete.
	(__trace_list_to_vector::__opr_iterate): Delete.
	(__trace_list_to_vector::__invalid_operator): Delete.
	(__trace_list_to_vector::__resize): Delete.
	(__trace_list_to_vector_free): New.
	(__trace_list_to_vector_report): Call __trace_report.
	(__trace_list_to_vector_construct): Return __list2vector_info*. Add
	check for reentrancy.
	* include/profile/impl/profiler_map_to_unordered_map.h
	(__map2umap_info()): Delete.
	(__map2umap_info(const __map2umap_info&)): Delete.
	(virtual ~__map2umap_info()): Delete.
	(__map2umap_info::__record_iterate): Use atomic operation.
	(__map2umap_info::__set_iterate_costs): New.
	(__map2umap_info::__record_invalidate): Delete.
	(__map2umap_info::_M_valid): Delete.
	(__trace_map2umap::__destruct): New.
	(__trace_map_to_unordered_map_free): New.
	(__trace_map_to_unordered_map_report): Call __trace_report.
	(__trace_map_to_unordered_map_construct): Return __map2umap_info*. Add
	check for reentrancy.
	* include/profile/impl/profiler_node.h (__object_t): Delete typedef.
	(__get_stack): Return null stack trace in case of (bad_alloc) exception.
	(__object_info_base()): Delete.
	(__object_info_base(const __object_info_base&)): Delete.
	(virtual ~__object_info_base()): Delete.
	(__object_info_base::__set_invalid): New.
	(__object_info_base::__merge): New.
	(virtual void __write(FILE*)): Delete.
	(class __stack_info_base): Delete.
	* include/profile/impl/profiler_trace.h (__global_lock): Rename into
	__global_mutex.
	(__trace_vector_size_free): New declaration.
	(__trace_hashtable_size_free): Likewise.
	(__trace_hash_func_free): Likewise.
	(__trace_vector_to_list_free): Likewise.
	(__trace_list_to_slist_free): Likewise.
	(__trace_list_to_vector_free): Likewise.
	(__trace_map_to_unordered_map_free): Likewise.
	(__trace_base::~__trace_base()): Not virtual anymore. Delete stored
	backtrace information.
	(__trace_base::__add_object): Return __object_info*, take only a stack
	trace.
	(__trace_base::__get_object_info): Delete.
	(__trace_base::__retire_object): Take __object_info* instead of
	__object_t.
	(__trace_base::__object_table_lock): Delete.
	(__trace_base::__stack_table_lock): Delete.
	(__trace_base::__object_table_t): Delete typedef.
	(__trace_base::__object_table): Delete.
	(__trace_base::__trace_mutex): New.
	(__trace_base::__object_byte_size): New.
	(__trace_report): New.
	(__report): Use __gnu_cxx::__scoped_lock to lock/unlock __global_mutex
	rather than explicitely calling lock() method, exception safe.
	(__report_and_free): New. Call __report and free all profile mode
	resources.
	(__profcxx_init_unconditional): Use __scoped_lock. Register
	__report_and_free with atexit.
	* include/profile/impl/profiler_vector_size.h
	(__trace_vector_size_free): New.
	(__trace_vector_size_report): Call __trace_report.
	(__trace_vector_size_construct): Return __container_size_info*. Add
	check for reentrancy.
	* include/profile/impl/profiler_vector_to_list.h
	(__vector2list_info()): Delete.
	(virtual ~__vector2list_info()): Delete.
	(__vector2list_info(const __vector2list_info&)): Delete.
	(__vector2list_info::__merge): Call __object_info_base::__merge.
	(__vector2list_info::__is_valid): Delete.
	(__vector2list_info::__set_valid): Delete.
	(__vector2list_info::__opr_find): Delete.
	(__vector2list_info::_M_valid): Delete.
	(__trace_vector_to_list::__insert): Delete.
	(__trace_vector_to_list::__find): Delete.
	(__trace_vector_to_list::__opr_insert): Delete.
	(__trace_vector_to_list::__opr_iterate): Delete.
	(__trace_vector_to_list::__invalid_operator): Delete.
	(__trace_vector_to_list::__resize): Delete.
	(__trace_vector_to_list::__opr_find): Delete.
	(__trace_vector_to_list_free): New.
	(__trace_vector_to_list_report): Call __trace_report.
	(__trace_vector_to_list_construct): Return __vector2list_info*. Add
	check for reentrancy.
	* include/profile/iterator_tracker.h
	(__iterator_tracker<>::operator=): Add missing _M_ds assignment.
	(__iterator_tracker<>::_M_find): Delete.
	* include/profile/impl/profiler.h
	([_GLIBCXX_PROFILE_REENTRANCE_GUARD]): Delete.
	(__container_size_info): Add class declaration.
	(__hashfunc_info): Likewise.
	(__map2umap_info): Likewise.
	(__vector2list_info): Likewise.
	(__list2slist_info): Likewise.
	(__list2vector_info): Likewise.
	(__trace_list_to_set_destruct): Delete declaration.
	(__trace_list_to_set_construct): Likewise.
	(__trace_list_to_set_insert): Likewise.
	(__trace_list_to_set_iterate): Likewise.
	(__trace_list_to_set_invalid_operator): Likewise.
	(__trace_list_to_set_find): Likewise.
	([__profcxx_report]): Remove usage of _GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_turn_on]): Likewise.
	([__profcxx_turn_off]): Likewise.
	([__profcxx_is_invalid]): Likewise.
	([__profcxx_is_on]): Likewise.
	([__profcxx_is_off]): Likewise.
	([__profcxx_hashtable_resize]): Likewise.
	([__profcxx_hashtable_destruct]): Likewise.
	([__profcxx_hashtable_construct]): Likewise.
	([__profcxx_vector_size_construct]): Likewise.
	([__profcxx_vector_size_resize]): Likewise.
	([__profcxx_vector_size_destruct]): Likewise.
	([__profcxx_inefficient_hash_is_on]): Delete.
	([__profcxx_hash_func_construct]): Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_hash_func_destruct]): Likewise.
	([__profcxx_vector_construct2]): Rename into...
	([__profcxx_vector2list_construct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_vector_insert]): Rename into...
	([__profcxx_vector2list_insert]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_vector_iterate]): Rename into...
	([__profcxx_vector2list_iterate]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_vector_invalid_operator]): Rename into...
	([__profcxx_vector2list_invalid_operator]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_vector_resize2]): Rename into...
	([__profcxx_vector2list_resize]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_vector_destruct2]): Rename into...
	([__profcxx_vector2list_destruct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_vector_find]): Delete.
	([__profcxx_list_construct2]): Rename into...
	([__profcxx_list2vector_construct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_list_insert]): Rename into...
	([__profcxx_list2vector_insert]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_list_iterate]): Rename into...
	([__profcxx_list2vector_iterate]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([_profcxx_list_invalid_operator]): Rename into...
	([__profcxx_list2vector_invalid_operator]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_list_destruct2]): Rename into...
	([__profcxx_list2vector_destruct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_list_construct]): Rename into...
	([__profcxx_list2slist_construct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_list_rewind]): Rename into...
	([__profcxx_list2slist_rewind]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_list_operation]): Rename into...
	([__profcxx_list2slist_operation]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_list_destruct]): Rename into...
	([__profcxx_list2slist_destruct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_map_to_unordered_map_construct]): Rename into...
	([__profcxx_map2umap_construct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_map_to_unordered_map_insert]): Rename into...
	([__profcxx_map2umap_insert]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_map_to_unordered_map_erase]): Rename into...
	([__profcxx_map2umap_erase]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_map_to_unordered_map_iterate]): Rename into...
	([__profcxx_map2umap_iterate]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_map_to_unordered_map_invalidate]): Rename into...
	([__profcxx_map2umap_invalidate]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_map_to_unordered_map_find]): Rename into...
	([__profcxx_map2umap_find]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	([__profcxx_map_to_unordered_map_destruct]): Rename into...
	([__profcxx_map2umap_destruct]): ... this. Remove usage of
	_GLIBCXX_PROFILE_REENTRANCE_GUARD.
	* include/profile/list
	(_List_profile): Adapt.
	(_List_profile::_M_profile_construct): New.
	(_List_profile()): Call latter.
	(_List_profile::_M_profile_destruct): New.
	(~_List_profile()): Call latter.
	(_List_profile::_M_swap): New.
	(_List_profile(_List_profile&&)): Call latter.
	(_List_profile::operator=(const _List_profile&)): Reinit profile
	structures.
	(_List_profile::operator=(_List_profile&&)): Move profile struct and
	re-init profile structures on moved instance.
	(std::__profile::list<>): Adapt.
	* include/profile/ordered_base.h
	(_Ordered_profile::_M_profile_iterate): New.
	(_Ordered_profile::_M_profile_construct): New.
	(_Ordered_profile()): Call latter.
	(_Ordered_profile::_M_swap): New.
	(_Ordered_profile(_Ordered_profile&&)): Call latter.
	(_Ordered_profile::operator=(const _Ordered_profile&)): Reinit
	profiling.
	(_Ordered_profile::operator=(_Ordered_profile&&)): Swap and reinit
	profiling on the moved instance.
	(_Ordered_profile::_M_profile_destruct): New.
	(~_Ordered_profile()): Call latter.
	* include/profile/map.h (std::__profile::map<>): Add profiling on
	iterators. Adapt.
	* include/profile/multimap.h (std::__profile::multimap<>): Likewise.
	* include/profile/set.h (std::__profile::set<>): Likewise.
	* include/profile/multiset.h (std::__profile::multiset<>): Likewise.
	* include/profile/unordered_base.h
	(_Unordered_profile::_M_profile_construct): New.
	(_Unordered_profile()): Call latter.
	(_Unordered_profile::_M_swap): New.
	(_Unordered_profile(_Unordered_profile&&)): Call latter.
	(_Unordered_profile::operator=(const _Unordered_profile&)): Reinit
	profiling.
	(_Unordered_profile::operator=(_Unordered_profile&&)): Swap and reinit
	profiling on the moved instance.
	(_Unordered_profile::_M_profile_destruct): New.
	(~_Ordered_profile()): Call latter.
	* include/profile/unordered_map
	(std::__profile::unordered_map<>): Adapt.
	(std::__profile::unordered_multimap<>): Adapt.
	* include/profile/unordered_set
	(std::__profile::unordered_set<>): Adapt.
	(std::__profile::unordered_multiset<>): Adapt.
	* include/profile/vector
	(_Vector_profile_pre::_M_profile_destruct): Move...
	(_Vector_profile_post::_M_profile_destruct): ...here.
	(_Vector_profile_post::_M_profile_construct): New.
	(_Vector_profile_post()): Call latter.
	(std::__profile::vector<>): Adapt.
	* testsuite/ext/profile/mh.cc: Rename into...
	* testsuite/ext/profile/replace_new.cc: ... this and fix test.

From-SVN: r217321
2014-11-10 21:51:58 +00:00
François Dumont 6c52b7dfc4 re PR libstdc++/63698 (std::set leaks nodes on assignment)
2014-11-04  François Dumont  <fdumont@gcc.gnu.org>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/63698
	* include/bits/stl_tree.h (_Reuse_or_alloc_node): Simplify constructor.
	Always move to the left node if there is one.
	* testsuite/23_containers/set/allocator/move_assign.cc (test04): New.

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

From-SVN: r217154
2014-11-05 19:16:13 +00:00
Jonathan Wakely 335a3ed6a1 numeric.h: Do not use default arguments in function template redeclarations (definitions).
* include/parallel/numeric.h: Do not use default arguments in function
	template redeclarations (definitions).

From-SVN: r217069
2014-11-04 03:41:16 +00:00
Jonathan Wakely d3cf41899e Do not assume allocator is assignable.
* include/bits/stl_deque.h (_Deque_base(_Deque_base&&)): Copy
	allocator instead of moving.
	* testsuite/23_containers/deque/allocator/move-2.cc: New.

From-SVN: r217068
2014-11-04 03:41:12 +00:00
Jonathan Wakely 565115eaaf Make reference_wrapper trivially copyable.
* include/std/functional (reference_wrapper): Define copy constructor
	and copy assignment as defaulted.
	* testsuite/20_util/bind/ref_neg.cc: Adjust dg-error.
	* testsuite/20_util/reference_wrapper/requirements.cc: New.

From-SVN: r217067
2014-11-04 02:49:33 +00:00
Jonathan Wakely ac6f071ad9 Use ctype_base::blank in regex_traits.
* include/bits/regex.h (regex_traits::_RegexMask): Remove _S_blank and
	adjust _S_valid_mask.
	* include/bits/regex.tcc (regex_traits::lookup_classname): Use
	ctype_base::blank.

From-SVN: r217066
2014-11-04 02:49:30 +00:00
Jonathan Wakely 9bcb72e0b0 * include/std/functional (_Bind_simple): Simplify construction.
From-SVN: r217065
2014-11-04 02:49:27 +00:00
Jonathan Wakely 8a57bed1d6 Use aliases for type traits in C++14 mode.
* include/bits/unique_ptr.h (make_unique): Use alias for trait.
	* include/experimental/optional (__constexpr_addressof): Likewise.
	(_Optional_base, optional, make_optional): Likewise.

From-SVN: r217064
2014-11-04 02:49:20 +00:00
Paolo Carlini 3384321048 algo.h: Do not use default arguments in function template redeclarations (definitions).
2014-11-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/parallel/algo.h: Do not use default arguments in function
	template redeclarations (definitions).

From-SVN: r217050
2014-11-03 17:54:59 +00:00
Jonathan Wakely afc449e82c Check number of arguments in bind expressions.
* include/std/functional (_Mem_fn_traits_base::__arity): New typedef.
	(_Mem_fn_base::_Arity): New typedef.
	(_Bind_check_arity): New class template.
	(_Bind_helper, _Bindres_helper, _Bind_simple_helper): Check arity.
	* testsuite/20_util/bind/ref_neg.cc: Adjust dg-error.

From-SVN: r217025
2014-11-03 02:55:36 +00:00
Jonathan Wakely 8d9076969b Add support for ref-qualified functions to std::mem_fn
PR libstdc++/57898
	* include/std/functional (_Mem_fn_traits_base): New class template.
	(_Mem_fn_traits): New class template with specializations for every
	combination of cv-qualified and ref-qualified member function.
	(_Mem_fn_base): New class template for all pointer to member function
	types and partial specialization for pointer to member object types.
	(_Mem_fn): Inherit from _Mem_fn_base.
	* testsuite/20_util/function_objects/mem_fn/refqual.cc: New.

From-SVN: r217024
2014-11-03 02:55:32 +00:00
Jonathan Wakely ccd615e3fd Make std::vector<bool> meet C++11 allocator requirements.
* include/bits/stl_bvector.h (_Bvector_base): Use allocator_traits.
	(_Bvector_base::_Bvector_impl): Use allocator's pointer type.
	(_Bvector_base::_M_end_addr()): Convert to raw pointer.
	(vector<bool>): Use allocator_traits and _M_end_addr. Add allocator
	extended constructors.
	* include/bits/vector.tcc (vector<bool>): Use allocator_traits and
	_M_end_addr.
	* testsuite/23_containers/vector/bool/allocator/copy.cc: New.
	* testsuite/23_containers/vector/bool/allocator/minimal.cc: New.
	* testsuite/23_containers/vector/bool/allocator/noexcept.cc: New.
	* testsuite/23_containers/vector/bool/allocator/copy_assign.cc: New.
	* testsuite/23_containers/vector/bool/allocator/move.cc: New.
	* testsuite/23_containers/vector/bool/allocator/swap.cc: New.
	* testsuite/23_containers/vector/bool/allocator/ext_ptr.cc: New.
	* testsuite/23_containers/vector/bool/allocator/move_assign.cc: New.

From-SVN: r216988
2014-10-31 20:49:40 +00:00
Jonathan Wakely a56561ac2d Use perfect forwarding in std::function invokers.
* include/std/functional: (_Function_base::_Function_base()): Use
	nullptr instead of literal zero.
	(function::operator=(nullptr_t)): Likewise.
	(_Function_handler::_M_invoke): Use perfect forwarding for _ArgTypes.
	(function::_Invoker_type): Likewise.
	* testsuite/20_util/function/invoke/forwarding.cc: New.

From-SVN: r216849
2014-10-29 18:38:31 +00:00
Jonathan Wakely c2513a1f6d any: Add feature-testing macro.
* include/experimental/any: Add feature-testing macro.
	* include/experimental/optional: Likewise.
	* include/experimental/string_view: Likewise.
	* include/experimental/tuple: Likewise.
	* include/experimental/type_traits: Likewise.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.

From-SVN: r216848
2014-10-29 18:22:05 +00:00
Jonathan Wakely 43e9f72225 Add <experimental/algorithm> and <experimental/functional>.
* doc/xml/manual/status_cxx2014.xml: Update TS status.
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Regenerate.
	* include/experimental/algorithm: New.
	* include/experimental/functional: New.
	* testsuite/experimental/algorithm/sample.cc: New.
	* testsuite/experimental/algorithm/search.cc: New.
	* testsuite/experimental/functional/not_fn.cc: New.
	* testsuite/experimental/functional/searchers.cc: New.
	* testsuite/experimental/functional/value.cc: New.
	* testsuite/experimental/feat-lib-fund.cc: Add headers and reorder.

From-SVN: r216847
2014-10-29 18:21:59 +00:00
Paolo Carlini 709def90a4 atomic_base.h: Avoid including <stdbool.h>.
2014-10-24  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/bits/atomic_base.h: Avoid including <stdbool.h>.
	* include/std/atomic: When __cplusplus < 201103L skip the rest of
	the header.
	* testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc: Adjust.

From-SVN: r216667
2014-10-24 12:54:43 +00:00
Tim Shen 4d8384337f re PR libstdc++/63497 (std::regex can't handle [^class] correctly and cause runtime crash)
PR libstdc++/63497
	include/bits/regex_executor.h (_Executor::_M_word_boundary): Remove
	unused parameter.
	include/bits/regex_executor.tcc (_Executor::_M_dfs,
	_Executor::_M_word_boundary): Avoid dereferecing _M_current at _M_end
	or other invalid position.

From-SVN: r216572
2014-10-23 03:15:52 +00:00
Ville Voutilainen 6b17203a20 Implement more Library Fundamentals v1 variable templates.
2014-10-21  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Implement more Library Fundamentals v1 variable templates.
	* include/Makefile.am: Add ratio, chrono and system_error.
	* include/Makefile.in: Regenerate.
	* include/experimental/chrono: New.
	* include/experimental/ratio: Likewise.
	* include/experimental/system_error: Likewise.
	* include/experimental/tuple (tuple_size_v): Likewise.
	* testsuite/experimental/chrono/value.cc: Likewise.
	* testsuite/experimental/ratio/value.cc: Likewise.
	* testsuite/experimental/system_error/value.cc: Likewise.
	* testsuite/experimental/tuple/tuple_size.cc: Likewise.

From-SVN: r216513
2014-10-21 14:10:51 +01:00
Jonathan Wakely a3e4cd810c Makefile.am: Move ctype.cc, ctype_configure_char.cc and ctype_members.cc to ...
* src/c++98/Makefile.am: Move ctype.cc, ctype_configure_char.cc and
	ctype_members.cc to ...
	* src/c++11/Makefile.am: Here.
	* src/c++98/Makefile.in: Regenerate.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++98/ctype.cc: Move file to ...
	* src/c++11/ctype.cc: Here, define ctype_base::blank.
	* config/abi/pre/gnu.ver: Export ctype_base::blank.
	* config/locale/generic/ctype_members.cc
	(ctype<wchar_t>::_M_convert_to_wmask): Handle blank. Update comments.
	* config/locale/gnu/ctype_members.cc
	(ctype<wchar_t>::_M_convert_to_wmask): Likewise.
	* config/os/aix/ctype_base.h (ctype_base::blank): Declare.
	* config/os/bionic/ctype_base.h (ctype_base::blank): Likewise.
	* config/os/bsd/darwin/ctype_base.h (ctype_base::blank): Declare.
	* config/os/bsd/darwin/ctype_inline.h (ctype<char>::is): Use blank.
	(ctype<wchar_t::do_is): Likewise.
	* config/os/bsd/dragonfly/ctype_base.h (ctype_base::blank): Declare.
	* config/os/bsd/dragonfly/ctype_inline.h (ctype<char>::is): Use blank.
	(ctype<wchar_t::do_is): Likewise.
	* config/os/bsd/freebsd/ctype_base.h (ctype_base::blank): Declare.
	* config/os/bsd/freebsd/ctype_inline.h (ctype<char>::is): Use blank.
	(ctype<wchar_t::do_is): Likewise.
	* config/os/bsd/netbsd/ctype_base.h (ctype_base::blank): Declare.
	* config/os/bsd/openbsd/ctype_base.h (ctype_base::blank): Likewise.
	* config/os/djgpp/ctype_base.h (ctype_base::blank): Likewise.
	* config/os/generic/ctype_base.h (ctype_base::blank): Declare.
	* config/os/generic/ctype_inline.h (ctype<char>::is): Use blank.
	* config/os/gnu-linux/ctype_base.h (ctype_base::blank): Declare.
	* config/os/hpux/ctype_base.h (ctype_base::blank): Likewise.
	* config/os/mingw32-w64/ctype_base.h (ctype_base::blank): Declare.
	* config/os/mingw32-w64/ctype_configure_char.cc
	(ctype<char>::classic_table()): Set blank bit for space and tab.
	* config/os/mingw32/ctype_base.h (ctype_base::blank): Declare.
	* config/os/mingw32/ctype_configure_char.cc
	(ctype<char>::classic_table()): Set blank bit for space and tab.
	* config/os/newlib/ctype_base.h (ctype_base::blank): Declare.
	* config/os/qnx/qnx6.1/ctype_base.h (ctype_base::blank): Likewise.
	* config/os/solaris/solaris2.10/ctype_base.h (ctype_base::blank):
	Likewise.
	* config/os/tpf/ctype_base.h (ctype_base::blank): Likewise.
	* config/os/uclibc/ctype_base.h (ctype_base::blank): Likewise.
	* config/os/vxworks/ctype_base.h (ctype_base::blank): Likewise.
	* include/bits/locale_facets.h (isblank): Define.
	* include/bits/localefwd.h (isblank): Declare.
	* testsuite/22_locale/classification/isblank.cc: New.
	* testsuite/22_locale/ctype_base/blank.cc: New.

From-SVN: r216464
2014-10-20 13:34:10 +01:00
Ville Voutilainen 37285913f3 Implement the Library Fundamentals v1 variable templates.
2014-10-17  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Implement the Library Fundamentals v1 variable templates.
	* include/Makefile.am: Add the new header.
	* include/Makefile.in: Regenerate.
	* include/experimental/type_traits: New.
	* testsuite/experimental/type_traits/value.cc: Likewise.

From-SVN: r216397
2014-10-17 13:21:21 +01:00
François Dumont 8a7fb87eae re PR libstdc++/63500 (bug in debug version of std::make_move_iterator?)
2014-10-15  François Dumont  <fdumont@gcc.gnu.org>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/63500
	* include/debug/functions.h (__foreign_iterator_aux2): Do not check for
	foreign iterators if input iterators returns rvalue reference.
	* testsuite/23_containers/vector/63500.cc: New.

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

From-SVN: r216286
2014-10-15 20:40:31 +00:00
Jonathan Wakely 327a79a523 complex (complex::real, [...]): Add const.
* include/std/complex (complex::real, complex::imag): Add const.
	* testsuite/26_numerics/complex/value_operations/constexpr2.cc: New.

From-SVN: r216258
2014-10-15 14:20:12 +01:00
Paolo Carlini cd9b223aaa limits: Remove stray semicolon.
2014-10-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/limits: Remove stray semicolon.

2014-10-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* testsuite/20_util/add_const/requirements/alias_decl.cc: Prefer
	-std=gnu++14.
	* testsuite/20_util/add_cv/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/add_lvalue_reference/requirements/alias_decl.cc:
	Likewise.
	* testsuite/20_util/add_pointer/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/add_rvalue_reference/requirements/alias_decl.cc:
	Likewise.
	* testsuite/20_util/add_volatile/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/aligned_storage/requirements/alias_decl.cc:
	Likewise.
	* testsuite/20_util/aligned_union/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/common_type/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/conditional/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/decay/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/duration/literals/61166.cc: Likewise.
	* testsuite/20_util/duration/literals/ns_detail.cc: Likewise.
	* testsuite/20_util/duration/literals/range.cc: Likewise.
	* testsuite/20_util/duration/literals/types.cc: Likewise.
	* testsuite/20_util/duration/literals/values.cc: Likewise.
	* testsuite/20_util/enable_if/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/exchange/1.cc: Likewise.
	* testsuite/20_util/function_objects/comparisons_void.cc: Likewise.
	* testsuite/20_util/integer_sequence/intseq.cc: Likewise.
	* testsuite/20_util/integer_sequence/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/integral_constant/call_operator.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/make_unsigned/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/pair/astuple/constexpr_get_by_type.cc: Likewise.
	* testsuite/20_util/pair/astuple/get_by_type.cc: Likewise.
	* testsuite/20_util/pair/astuple/get_by_type_neg.cc: Likewise.
	* testsuite/20_util/pair/astuple/get_neg.cc: Likewise.
	* testsuite/20_util/remove_all_extents/requirements/alias_decl.cc:
	Likewise.
	* testsuite/20_util/remove_const/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/remove_cv/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/remove_extent/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/remove_pointer/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/remove_reference/requirements/alias_decl.cc:
	Likewise.
	* testsuite/20_util/remove_volatile/requirements/alias_decl.cc:
	Likewise.
	* testsuite/20_util/result_of/requirements/alias_decl.cc: Likewise.
	* testsuite/20_util/tuple/element_access/constexpr_get_by_type.cc:
	Likewise.
	* testsuite/20_util/tuple/element_access/get2_by_type.cc: Likewise.
	* testsuite/20_util/tuple/element_access/get_by_type.cc: Likewise.
	* testsuite/20_util/underlying_type/requirements/alias_decl.cc:
	Likewise.
	* testsuite/20_util/unique_ptr/creation/array.cc: Likewise.
	* testsuite/20_util/unique_ptr/creation/array_neg.cc: Likewise.
	* testsuite/20_util/unique_ptr/creation/single.cc: Likewise.
	* testsuite/21_strings/basic_string/literals/types.cc: Likewise.
	* testsuite/21_strings/basic_string/literals/values.cc: Likewise.
	* testsuite/25_algorithms/equal/2.cc: Likewise.
	* testsuite/25_algorithms/equal/check_type2.cc: Likewise.
	* testsuite/25_algorithms/is_permutation/2.cc: Likewise.
	* testsuite/25_algorithms/is_permutation/check_type2.cc: Likewise.
	* testsuite/25_algorithms/is_permutation/vectorbool.cc: Likewise.
	* testsuite/25_algorithms/mismatch/2.cc: Likewise.
	* testsuite/25_algorithms/mismatch/check_type2.cc: Likewise.
	* testsuite/26_numerics/complex/literals/values.cc: Likewise.
	* testsuite/27_io/manipulators/standard/char/quoted.cc: Likewise.
	* testsuite/27_io/manipulators/standard/wchar_t/quoted.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/1.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/2.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/3.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/4.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/5.cc: Likewise.
	* testsuite/30_threads/shared_lock/cons/6.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/1.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/2.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/3.cc: Likewise.
	* testsuite/30_threads/shared_lock/locking/4.cc: Likewise.
	* testsuite/30_threads/shared_lock/modifiers/1.cc: Likewise.
	* testsuite/30_threads/shared_lock/modifiers/2.cc: Likewise.
	* testsuite/30_threads/shared_lock/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/30_threads/shared_lock/requirements/typedefs.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/cons/1.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/cons/assign_neg.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/cons/copy_neg.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/requirements/
	standard_layout.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/try_lock/1.cc: Likewise.
	* testsuite/30_threads/shared_timed_mutex/try_lock/2.cc: Likewise.
	* testsuite/experimental/optional/assignment/1.cc: Likewise.
	* testsuite/experimental/optional/assignment/2.cc: Likewise.
	* testsuite/experimental/optional/assignment/3.cc: Likewise.
	* testsuite/experimental/optional/assignment/4.cc: Likewise.
	* testsuite/experimental/optional/assignment/5.cc: Likewise.
	* testsuite/experimental/optional/assignment/6.cc: Likewise.
	* testsuite/experimental/optional/cons/copy.cc: Likewise.
	* testsuite/experimental/optional/cons/default.cc: Likewise.
	* testsuite/experimental/optional/cons/move.cc: Likewise.
	* testsuite/experimental/optional/cons/value.cc: Likewise.
	* testsuite/experimental/optional/constexpr/cons/default.cc: Likewise.
	* testsuite/experimental/optional/constexpr/cons/value.cc: Likewise.
	* testsuite/experimental/optional/constexpr/in_place.cc: Likewise.
	* testsuite/experimental/optional/constexpr/make_optional.cc: Likewise.
	* testsuite/experimental/optional/constexpr/nullopt.cc: Likewise.
	* testsuite/experimental/optional/constexpr/observers/1.cc: Likewise.
	* testsuite/experimental/optional/constexpr/observers/2.cc: Likewise.
	* testsuite/experimental/optional/constexpr/observers/3.cc: Likewise.
	* testsuite/experimental/optional/constexpr/observers/4.cc: Likewise.
	* testsuite/experimental/optional/constexpr/observers/5.cc: Likewise.
	* testsuite/experimental/optional/constexpr/relops/1.cc: Likewise.
	* testsuite/experimental/optional/constexpr/relops/2.cc: Likewise.
	* testsuite/experimental/optional/constexpr/relops/3.cc: Likewise.
	* testsuite/experimental/optional/constexpr/relops/4.cc: Likewise.
	* testsuite/experimental/optional/constexpr/relops/5.cc: Likewise.
	* testsuite/experimental/optional/constexpr/relops/6.cc: Likewise.
	* testsuite/experimental/optional/in_place.cc: Likewise.
	* testsuite/experimental/optional/make_optional.cc: Likewise.
	* testsuite/experimental/optional/nullopt.cc: Likewise.
	* testsuite/experimental/optional/observers/1.cc: Likewise.
	* testsuite/experimental/optional/observers/2.cc: Likewise.
	* testsuite/experimental/optional/observers/3.cc: Likewise.
	* testsuite/experimental/optional/observers/4.cc: Likewise.
	* testsuite/experimental/optional/observers/5.cc: Likewise.
	* testsuite/experimental/optional/relops/1.cc: Likewise.
	* testsuite/experimental/optional/relops/2.cc: Likewise.
	* testsuite/experimental/optional/relops/3.cc: Likewise.
	* testsuite/experimental/optional/relops/4.cc: Likewise.
	* testsuite/experimental/optional/relops/5.cc: Likewise.
	* testsuite/experimental/optional/relops/6.cc: Likewise.
	* testsuite/experimental/optional/requirements.cc: Likewise.
	* testsuite/experimental/optional/swap/1.cc: Likewise.
	* testsuite/experimental/string_view/capacity/1.cc: Likewise.
	* testsuite/experimental/string_view/cons/char/1.cc: Likewise.
	* testsuite/experimental/string_view/cons/char/2.cc: Likewise.
	* testsuite/experimental/string_view/cons/char/3.cc: Likewise.
	* testsuite/experimental/string_view/cons/wchar_t/1.cc: Likewise.
	* testsuite/experimental/string_view/cons/wchar_t/2.cc: Likewise.
	* testsuite/experimental/string_view/cons/wchar_t/3.cc: Likewise.
	* testsuite/experimental/string_view/element_access/char/1.cc: Likewise.
	* testsuite/experimental/string_view/element_access/char/2.cc: Likewise.
	* testsuite/experimental/string_view/element_access/char/empty.cc: 
	Likewise.
	* testsuite/experimental/string_view/element_access/char/
	front_back.cc: Likewise.
	* testsuite/experimental/string_view/element_access/wchar_t/1.cc:
	Likewise.
	* testsuite/experimental/string_view/element_access/wchar_t/2.cc:
	Likewise.
	* testsuite/experimental/string_view/element_access/wchar_t/empty.cc:
	Likewise.
	* testsuite/experimental/string_view/element_access/wchar_t/
	front_back.cc: Likewise.
	* testsuite/experimental/string_view/include.cc: Likewise.
	* testsuite/experimental/string_view/inserters/char/1.cc: Likewise.
	* testsuite/experimental/string_view/inserters/char/2.cc: Likewise.
	* testsuite/experimental/string_view/inserters/char/3.cc: Likewise.
	* testsuite/experimental/string_view/inserters/pod/10081-out.cc:
	Likewise.
	* testsuite/experimental/string_view/inserters/wchar_t/1.cc: Likewise.
	* testsuite/experimental/string_view/inserters/wchar_t/2.cc: Likewise.
	* testsuite/experimental/string_view/inserters/wchar_t/3.cc: Likewise.
	* testsuite/experimental/string_view/literals/types.cc: Likewise.
	* testsuite/experimental/string_view/literals/values.cc: Likewise.
	* testsuite/experimental/string_view/modifiers/remove_prefix/char/
	1.cc: Likewise.
	* testsuite/experimental/string_view/modifiers/remove_prefix/
	wchar_t/1.cc: Likewise.
	* testsuite/experimental/string_view/modifiers/remove_suffix/
	char/1.cc: Likewise.
	* testsuite/experimental/string_view/modifiers/remove_suffix/
	wchar_t/1.cc: Likewise.
	* testsuite/experimental/string_view/operations/compare/char/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/compare/char/13650.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/compare/wchar_t/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/compare/wchar_t/
	13650.cc: Likewise.
	* testsuite/experimental/string_view/operations/copy/char/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/copy/wchar_t/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/data/char/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/data/wchar_t/1.cc: 
	Likewise.
	* testsuite/experimental/string_view/operations/find/char/1.cc: 
	Likewise.
	* testsuite/experimental/string_view/operations/find/char/2.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/find/char/3.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/find/char/4.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/find/wchar_t/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/find/wchar_t/2.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/find/wchar_t/3.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/find/wchar_t/4.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/rfind/char/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/rfind/char/2.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/rfind/char/3.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/rfind/wchar_t/1.cc:
	Likewise.
	* testsuite/experimental/string_view/operations/rfind/wchar_t/2.cc: 
	Likewise.
	* testsuite/experimental/string_view/operations/rfind/wchar_t/3.cc: 
	Likewise.
	* testsuite/experimental/string_view/operations/substr/char/1.cc: 
	Likewise.
	* testsuite/experimental/string_view/operations/substr/wchar_t/1.cc: 
	Likewise.
	* testsuite/experimental/string_view/operations/to_string/1.cc: 
	Likewise.
	* testsuite/experimental/string_view/operators/char/2.cc: Likewise.
	* testsuite/experimental/string_view/operators/wchar_t/2.cc: Likewise.
	* testsuite/experimental/string_view/range_access/char/1.cc: Likewise.
	* testsuite/experimental/string_view/range_access/wchar_t/1.cc: 
	Likewise.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/1.cc: Likewise.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/char/1.cc: Likewise.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/char16_t/1.cc: Likewise.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/char32_t/1.cc: Likewise.
	* testsuite/experimental/string_view/requirements/
	explicit_instantiation/wchar_t/1.cc: Likewise.
	* testsuite/experimental/string_view/requirements/typedefs.cc: Likewise.
	* testsuite/experimental/string_view/types/1.cc: Likewise.

From-SVN: r216257
2014-10-15 12:03:20 +00:00
Paolo Carlini 7f3083e71d limits: Remove stray spaces after backslash.
2014-10-15  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/std/limits: Remove stray spaces after backslash.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r216242
2014-10-15 08:51:07 +00:00
DJ Delorie 78a7c3172f machmode.h (int_n_data_t): New.
* machmode.h (int_n_data_t): New.
	(int_n_enabled_p): New.
	(int_n_data): New.
	* tree.c (int_n_enabled_p): New.
	(int_n_trees): New.
	(make_or_reuse_type): Check for all __intN types, not just
	__int128.
	(build_common_tree_nodes): Likewise.  Also fill in integer_typs[]
	entries.
	* tree.h (int128_integer_type_node): Remove.
	(int128_unsigned_type_node): Remove.
	(int_n_trees_t): New.
	(int_n_enabled_p): New.
	(int_n_trees): New.
	* toplev.c (standard_type_bitsize): New.
	(do_compile): Check which __intN types are enabled for the current
	run.
	* builtin-types.def (BT_INT128): Remove.
	(BT_UINT128): Remove.
	* machmode.def: Add macro to create __int128 for all targets.
	* stor-layout.c (mode_for_size): Support __intN types.
	(smallest_mode_for_size): Likewise.
	(initialize_sizetypes): Support __intN types.
	* genmodes.c (struct mode_data): Add int_n field.
	(blank_mode): Likewise.
	(INT_N): New.
	(make_int_n): New.
	(emit_insn_modes_h): Count __intN entries and define
	NUM_INT_N_ENTS.
	(emit_mode_int_n): New.
	(emit_insn_modes_c): Call it.
	* gimple.c (gimple_signed_or_unsigned_type): Check for all __intN
	types, not just __int128.
	* tree-core.h (integer_type_kind): Remove __int128-specific
	entries, reserve spots for __intN entries.

libstdc++-v3/
	* src/c++11/limits.cc: Add support for __intN types.
	* include/std/type_traits: Likewise.
	* include/std/limits: Likewise.
	* include/c_std/cstdlib: Likewise.
	* include/bits/cpp_type_traits.h: Likewise.
	* include/c_global/cstdlib: Likewise.

c-family/
	* c-pretty-print.c (pp_c_integer_constant): Check for all __intN
	types, not just __int128.
	* c-cppbuiltin.c (c_cpp_builtins): Add builtins for all __intN
	types, not just __int128.
	(cpp_atomic_builtins): Round pointer sizes up.
	(type_suffix): Use type precision, not specific types.
	* c-common.c (c_common_reswords): Remove __int128 special case.
	(c_common_type_for_size): Check for all __intN types, not just
	__int128.
	(c_common_type_for_mode): Likewise.
	(c_common_signed_or_unsigned_type): Likewise.
	(c_build_bitfield_integer_type): Likewise.
	(c_common_nodes_and_builtins): Likewise.
	(keyword_begins_type_specifier): Likewise.
	* c-common.h (rid): Remove RID_INT128 and add RID_INT_N_* for all
	__intN variants.

c/
	* c-parser.c (c_parse_init): Add RID entries for each __intN.
	(c_token_starts_typename): Check all __intN, not just __int128.
	(c_token_starts_declspecs): Likewise.
	(c_parser_declspecs): Likewise.
	(c_parser_attribute_any_word): Likewise.
	(c_parser_objc_selector): Likewise.
	* c-tree.h (c_typespec_keyword): cts_int128 -> cts_int_n.
	(struct c_declspecs): Add int_n_idx field to record *which* __intN
	is specified.
	* c-decl.c (declspecs_add_type): Check for all __intN, not just
	__int128.
	(finish_declspecs): Likewise.

testsuite/
	* g++.dg/abi/mangle64.C: New.

cp/
	* typeck.c (cp_common_type): Check for all __intN types, not just
	__int128.
	* decl.c (grokdeclarator): Likewise.
	* rtti.c (emit_support_tinfos): Check for all __intN types, not just
	__int128.
	* parser.c (cp_lexer_next_token_is_decl_specifier_keyword): Check
	for all __intN types, not just __int128.
	(cp_parser_simple_type_specifier): Likewise.
	* mangle.c (integer_type_codes): Remove int128-specific codes.
	* cp-tree.h (cp_decl_specifier_seq): Add int_n_idx to store which
	__intN was specified.
	* lex.c (init_reswords): Reserve all __intN keywords.

lto/
	* lto-lang.c (lto_build_c_type_nodes): Check intN types for
	size-type as well.
	(lto_init): Initialize all intN types, not just int128.

From-SVN: r216220
2014-10-14 15:44:36 -04:00
Rüdiger Sonderfeld ffffc732ef re PR libstdc++/54354 (TODO extended iomanip manipulators std::get_time and std::put_time (C++11, section 27.7.5))
2014-10-14  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>

	PR libstdc++/54354
	* include/std/iomanip (_Put_time): New struct.
	(put_time): New manipulator.
	(operator<<): New overloaded function.
	* testsuite/27_io/manipulators/extended/put_time/char/1.cc: New.
	* testsuite/27_io/manipulators/extended/put_time/char/2.cc: New.
	* testsuite/27_io/manipulators/extended/put_time/wchar_t/1.cc: New.
	* testsuite/27_io/manipulators/extended/put_time/wchar_t/2.cc: New.

From-SVN: r216211
2014-10-14 18:01:25 +01:00
Jonathan Wakely 01d6452fe5 re PR libstdc++/57350 (std::align missing)
PR libstdc++/57350
	* include/std/memory (align): Do not adjust correctly aligned address.
	* testsuite/20_util/align/2.cc: New.

From-SVN: r216149
2014-10-13 15:08:44 +01:00
Rüdiger Sonderfeld 2f6ca9d317 memory (align): Define.
2014-10-13  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>

	* include/std/memory (align): Define.
	* testsuite/20_util/align/1.cc: New.

From-SVN: r216143
2014-10-13 11:05:21 +01:00
Marc Glisse 2a52738350 re PR libstdc++/61347 (std::distance(list.first(),list.end()) in O(1))
2014-10-13  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/61347
	PR libstdc++/63345
	* include/bits/list.tcc (_List_base::_M_clear()): Delay cast so it
	isn't done for the sentinel.
	* include/bits/stl_list.h (_List_base::_M_size): Move...
	(_List_base::_List_impl::_M_node): ... here.
	(_List_base::_M_get_size(), _List_base::_M_set_size(size_t),
	_List_base::_M_inc_size(size_t), _List_base::_M_dec_size(size_t),
	_List_base::_M_node_count): Adapt to the move.
	* 23_containers/list/requirements/dr438/assign_neg.cc: Update
	line number.
	* 23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise.
	* 23_containers/list/requirements/dr438/constructor_2_neg.cc: Likewise.
	* 23_containers/list/requirements/dr438/insert_neg.cc: Likewise.

From-SVN: r216142
2014-10-13 10:00:27 +00:00
Jonathan Wakely 375f837be1 re PR libstdc++/49561 ([C++0x] std::list::size complexity)
PR libstdc++/49561
	* acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_CXX11_ABI): Define.
	* configure.ac: Use GLIBCXX_ENABLE_LIBSTDCXX_CXX11_ABI.
	* configure: Regenerate.
	* include/Makefile.am (stamp-cxx11-abi): New target.
	(c++config.h): Set _GLIBCXX_USE_CXX11_ABI macro.
	* include/Makefile.in: Regenerate.
	* include/bits/c++config: Add _GLIBCXX_USE_CXX11_ABI placeholder and
	define _GLIBCXX_DEFAULT_ABI_TAG.
	* include/bits/list.tcc (list::emplace(const_iterator, _Args&...)):
	Increment size.
	(list::emplace(const_iterator, const value_type&)): Likewise.
	(list::merge(list&), list::merge(list&, _StrictWeakOrdering)): Adjust
	list sizes.
	* include/bits/stl_list.h (_List_base, list): Add ABI tag macro.
	(_List_base::_M_size): New data member in cxx11 ABI mode.
	(_List_base::_S_distance(_List_node_base*, _List_node_base*)): New
	function.
	(_List_base::_M_get_size(), _List_base::_M_set_size(size_t),
	_List_base::_M_inc_size(size_t), _List_base::_M_dec_size(size_t),
	_List_base::_M_distance, _List_base::_M_node_count): New functions for
	accessing list size correctly for the ABI mode.
	(_List_base::_List_base(_List_base&&)): Copy size and reset source.
	(_List_base::_M_init()): Initialize size member.
	(list::size()): Use _List_base::_M_node_count.
	(list::swap(list&)): Swap sizes.
	(list::splice(iterator, list&)): Update sizes.
	(list::splice(iterator, list&, iterator)): Likewise.
	(list::insert(iterator, const value_type&)): Update size.
	(list::insert(iterator, _Args&&...)): Likewise.
	(list::_M_erase(iterator)): Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Adjust.
	* testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
	Adjust.
	* testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
	Adjust.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Adjust.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust.

From-SVN: r216094
2014-10-10 16:33:57 +01:00
Jonathan Wakely c386686921 re PR libstdc++/61909 (Small function optimization not applied to small objects)
PR libstdc++/61909
	* include/std/functional (__is_location_invariant): Treat all
	trivially copyable types as location invariant.

From-SVN: r216047
2014-10-09 19:17:28 +01:00
Jonathan Wakely bc2da0fc04 re PR libstdc++/63322 (std::atomic<T> where T is not trivially copyable should be disabled.)
PR libstdc++/63322
	* include/std/atomic (atomic): Add assertion for trivially copyable.
	* testsuite/29_atomics/atomic/60695.cc: Adjust line number.

From-SVN: r216046
2014-10-09 19:17:23 +01:00
Ville Voutilainen f5e523b76d re PR libstdc++/60132 (C++11: lack of is_trivially_copy_constructible)
2014-10-09  Ville Voutilainen  <ville.voutilainen@gmail.com>

	PR libstdc++/60132
    	* include/std/type_traits (is_trivially_copyable,
    	is_trivially_constructible, is_trivially_default_constructible,
    	is_trivially_copy_constructible, is_trivially_move_constructible,
    	is_trivially_assignable, is_trivially_copy_assignable,
    	is_trivially_move_assignable): New.
    	* testsuite/20_util/is_trivially_assignable/requirements/
    	typedefs.cc: Likewise.
    	* testsuite/20_util/is_trivially_assignable/requirements/
    	explicit_instantiation.cc: Likewise.
    	* testsuite/20_util/is_trivially_assignable/value.cc: Likewise.
	* testsuite/20_util/is_trivially_constructible/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/is_trivially_constructible/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_trivially_constructible/value.cc: Likewise.
	* testsuite/20_util/is_trivially_copyable/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/is_trivially_copyable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_trivially_copyable/value.cc: Likewise.
	* testsuite/20_util/is_trivially_copy_assignable/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/is_trivially_copy_assignable/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/is_trivially_copy_assignable/value.cc: Likewise.
	* testsuite/20_util/is_trivially_copy_constructible/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/is_trivially_copy_constructible/requirements/
	explicit_instantiation.cc: Likewise.
    	* testsuite/20_util/is_trivially_copy_constructible/value.cc: Likewise.
    	* testsuite/20_util/is_trivially_default_constructible/requirements/
    	typedefs.cc: Likewise.
    	* testsuite/20_util/is_trivially_default_constructible/requirements/
    	explicit_instantiation.cc: Likewise.
    	* testsuite/20_util/is_trivially_default_constructible/
	value.cc: Likewise.
    	* testsuite/20_util/is_trivially_move_assignable/requirements/
    	typedefs.cc: Likewise.
    	* testsuite/20_util/is_trivially_move_assignable/requirements/
    	explicit_instantiation.cc: Likewise.
    	* testsuite/20_util/is_trivially_move_assignable/value.cc: Likewise.
    	* testsuite/20_util/is_trivially_move_constructible/requirements/
    	typedefs.cc: Likewise.
    	* testsuite/20_util/is_trivially_move_constructible/requirements/
    	explicit_instantiation.cc: Likewise.
    	* testsuite/20_util/is_trivially_move_constructible/value.cc:
	Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r216032
2014-10-09 08:37:26 +00:00
Jonathan Wakely 9d07d890e6 locale_facets.tcc (num_put::_M_insert_float): Do not pass precision when using hexfloat format.
* include/bits/locale_facets.tcc (num_put::_M_insert_float): Do not
	pass precision when using hexfloat format.
	* src/c++98/locale_facets.cc (__num_base::_S_format_float): Always
	output precision if C99 hexfloat conversion specifiers not available.

From-SVN: r216001
2014-10-08 14:25:30 +01:00
Jonathan Wakely 7dd9b46d29 regex.h (regex_token_iterator::_M_end_of_seq): Add const qualifier.
* include/bits/regex.h (regex_token_iterator::_M_end_of_seq): Add
	const qualifier.

From-SVN: r215995
2014-10-08 09:49:22 +01:00
Rüdiger Sonderfeld c4b64f5bca re PR libstdc++/59987 ([C++11]: Missing ios_base::hexfloat format specifier)
2014-10-06  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/59987
	* doc/xml/manual/status_cxx2011.xml: Remove hexfloat from notes.
	* doc/html/manual/status.html: Regenerate.
	* include/bits/ios_base.h (hexfloat): New function.
	(defaultfloat): New function.
	* src/c++98/locale_facets.cc (__num_base::_S_format_float): Support
	hexadecimal floating point format.
	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
	New file.

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

From-SVN: r215952
2014-10-06 16:55:53 +01:00
Jonathan Wakely 22274fac01 Makefile.am: Add new header.
* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/experimental/tuple: New
	* doc/xml/manual/status_cxx2014.xml: Update.
	* doc/html/manual/status.html: Regenerate.
	* testsuite/experimental/feat-lib-fund.cc: Test for new header.
	* testsuite/experimental/tuple/apply.cc: New.

From-SVN: r215930
2014-10-06 13:26:45 +01:00
François Dumont e6fb44d878 re PR libstdc++/63456 (unordered_map incorrectly frees _M_single_bucket. Patch Included)
2014-10-05  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/63456
	* include/bits/hashtable.h (_M_uses_single_bucket(__bucket_type*)): Test
	the parameter.
	* testsuite/23_containers/unordered_set/63456.cc: New.

From-SVN: r215905
2014-10-05 18:44:46 +00:00
Jonathan Wakely d17f7d8a9d ctgmath: Include <complex>.
* include/c_global/ctgmath: Include <complex>.
	* testsuite/26_numerics/headers/ctgmath/complex.cc: New.
	* doc/xml/manual/status_cxx2011.xml: Update.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r215803
2014-10-02 16:52:24 +01:00
Edward Smith-Rowland f65eb9e641 stl_function.h: Generic associative lookup feature is not supported.
2014-10-02  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/bits/stl_function.h: Generic associative lookup feature
	is not supported.
	* testsuite/experimental/feat-lib-fund.cc: <experimental/any> is
	actually available.
	* testsuite/experimental/feat-cxx14.cc: Add test for __cpp_lib_is_final.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
	* testsuite/20_util/duration/literals/range.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Adjust.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Adjust.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust.
	* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
	Adjust.

From-SVN: r215801
2014-10-02 12:38:41 +00:00
Edward Smith-Rowland 4db7fcb9a8 type_traits: Add is_final<> type trait for C++14.
2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/std/type_traits: Add is_final<> type trait for C++14.
	* testsuite/util/testsuite_tr1.h: Add 
	* testsuite/20_util/is_final/requirements/
	explicit_instantiation.cc: New.
	* testsuite/20_util/is_final/requirements/typedefs.cc: New.
	* testsuite/20_util/is_final/value.cc: New.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Adjust.

From-SVN: r215753
2014-10-01 11:59:29 +00:00
Edward Smith-Rowland a15f7cb8b8 Implement SD-6: SG10 Feature Test Recommendations
2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement SD-6: SG10 Feature Test Recommendations
	* internal.h (lexer_state, spec_nodes): Add in__has_include__.
	* directives.c: Support __has_include__ builtin.
	* expr.c (parse_has_include): New function to parse __has_include__
	builtin; (eval_token()): Use it.
	* files.c (_cpp_has_header()): New funtion to look for header;
	(open_file_failed()): Not an error to not find a header file for
	__has_include__.
	* identifiers.c (_cpp_init_hashtable()): Add entry for __has_include__.
	* pch.c (cpp_read_state): Lookup __has_include__.
	* traditional.c (enum ls, _cpp_scan_out_logical_line()): Walk through
	__has_include__ statements.

2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement SD-6: SG10 Feature Test Recommendations
	* c-cppbuiltin.c (c_cpp_builtins()): Define language feature
	macros and the __has_header macro.

2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement SD-6: SG10 Feature Test Recommendations
	* include/bits/basic_string.h: Add __cpp_lib feature test macro.
	* include/bits/stl_algobase.h: Ditto.
	* include/bits/stl_function.h: Ditto.
	* include/bits/unique_ptr.h: Ditto.
	* include/std/chrono: Ditto.
	* include/std/complex: Ditto.
	* include/std/iomanip: Ditto.
	* include/std/shared_mutex: Ditto.
	* include/std/tuple: Ditto.
	* include/std/type_traits: Ditto.
	* include/std/utility: Ditto.
	* testsuite/experimental/feat-cxx14.cc: New.
	* testsuite/experimental/feat-lib-fund.cc: New.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
	* testsuite/20_util/duration/literals/range.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Adjust.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Adjust.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Adjust.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust.
	* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
	Adjust.

2014-10-01  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Implement SD-6: SG10 Feature Test Recommendations
	* g++.dg/cpp1y/feat-cxx11-neg.C: New.
	* g++.dg/cpp1y/feat-cxx11.C: New.
	* g++.dg/cpp1y/feat-cxx14.C: New.
	* g++.dg/cpp1y/feat-cxx98.C: New.
	* g++.dg/cpp1y/feat-cxx98-neg.C: New.
	* g++.dg/cpp1y/phoobhar.h: New.
	* g++.dg/cpp1y/testinc/phoobhar.h: New.

From-SVN: r215752
2014-10-01 11:49:23 +00:00
François Dumont ebd4c354b3 re PR libstdc++/62313 (Data race in debug iterators)
2014-09-29  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/62313
	* include/debug/safe_base.h
	(_Safe_iterator_base(const _Safe_iterator_base&)): Delete declaration.
	(_Safe_iterator_base& operator=(const _Safe_iterator_base&)): Likewise.
	* include/debug/safe_iterator.h (_Safe_iterator<>): Move normal iterator
	before _Safe_iterator_base in memory. Lock before modifying the iterator
	in numerous places.
	* include/debug/safe_local_iterator.h
	(_Safe_local_iterator_base(const _Safe_local_iterator_base&)): Delete
	declaration.
	(_Safe_local_iterator_base& operator=(const _Safe_local_iterator_base&)):
	Likewise.
	* include/debug/safe_unordered_base.h (_Safe_local_iterator<>):  Move
	normal iterator before _Safe_iterator_base in memory. Lock before
	modifying the iterator in numerous places.
	* include/debug/forward_list (_Safe_forward_list<>::_M_swap_aux): Adapt.
	* include/debug/safe_sequence.tcc
	(_Safe_sequence<>::_M_transfer_from_if): Adapt.

From-SVN: r215693
2014-09-29 21:22:17 +00:00
Jonathan Wakely e51cf2f559 DR 1339
DR 1339
	* doc/xml/manual/status_cxx2011.xml: Update.
	* include/bits/stl_uninitialized.h (uninitialized_fill_n): Return
	an iterator.
	(__uninitialized_fill_n_a, __uninitialized_default_n_a): Likewise.
	* include/bits/stl_vector.h (vector::_M_fill_initialize,
	vector::_M_default_initialize): Use returned iterator.
	* include/bits/vector.tcc (vector::_M_fill_assign,
	vector::_M_fill_insert, vector::_M_default_append): Likewise.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
	16505.cc: Adjust return type.
	* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
	dr1339.cc: New.

From-SVN: r215606
2014-09-25 16:27:18 +01:00
Jonathan Wakely c5b2614754 * include/bits/vector.tcc (vector::_M_fill_assign): Use _M_swap_data.
From-SVN: r215596
2014-09-25 13:14:15 +01:00
Tim Shen 2bde8cac37 re PR libstdc++/63199 (Inserting std::wregex to std::vector loses some std::wregex values)
PR libstdc++/63199
	* include/bits/regex.h (basic_regex::basic_regex, basic_regex::assign,
	basic_regex::imbue, basic_regex::getloc, basic_regex::swap): Add
	_M_loc for basic_regex.
	* include/bits/regex_automaton.h: Add _M_traits for _NFA.
	* include/bits/regex_compiler.h (_Compiler::_M_get_nfa, __compile_nfa):
	Make _Compiler::_M_nfa heap allocated.
	* include/bits/regex_compiler.tcc (_Compiler::_Compiler): Make
	_Compiler::_M_nfa heap allocated.
	* include/bits/regex_executor.h (_Executor::_M_is_word):
	Fix accessing _M_traits.
	* include/bits/regex_executor.tcc (_Executor::_M_dfs):
	Fix accessing _M_traits.
	* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/63199.cc:
	New testcase.

From-SVN: r215578
2014-09-25 04:43:19 +00:00
Jonathan Wakely 2d57872662 re PR libstdc++/56193 (ios_base should replace operator void* with explicit operator bool in C++11 onwards.)
PR libstdc++/56193
	* config/abi/pre/gnu.ver: Add new exports.
	* include/bits/basic_ios.h (basic_ios::operator bool): Define.
	* src/c++98/ios_locale.cc (basic_ios::operator void*): Instantiate.

From-SVN: r215571
2014-09-24 23:13:35 +01:00
François Dumont c6195f588b re PR libstdc++/29988 (More stl_tree.h enhancements: improving operator=)
2014-09-24  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/29988
	* include/bits/stl_tree.h (_Rb_tree_reuse_or_alloc_node<>): New.
	(_Rb_tree_alloc_node<>): New.
	(_Rb_tree<>::operator=(_Rb_tree<>&&)): New.
	(_Rb_tree<>::_M_assign_unique): New.
	(_Rb_tree<>::_M_assign_equal): New.
	(_Rb_tree<>): Adapt to reuse allocated nodes as much as possible.
	* include/bits/stl_map.h
	(std::map<>::operator=(std::map<>&&)): Default implementation.
	(std::map<>::operator=(initializer_list<>)): Adapt to use
	_Rb_tree::_M_assign_unique.
	* include/bits/stl_multimap.h
	(std::multimap<>::operator=(std::multimap<>&&)): Default implementation.
	(std::multimap<>::operator=(initializer_list<>)): Adapt to use
	_Rb_tree::_M_assign_equal.
	* include/bits/stl_set.h
	(std::set<>::operator=(std::set<>&&)): Default implementation.
	(std::set<>::operator=(initializer_list<>)): Adapt to use
	_Rb_tree::_M_assign_unique.
	* include/bits/stl_multiset.h
	(std::multiset<>::operator=(std::multiset<>&&)): Default implementation.
	(std::multiset<>::operator=(initializer_list<>)): Adapt to use
	_Rb_tree::_M_assign_equal.
	* testsuite/23_containers/map/allocator/copy_assign.cc (test03): New.
	* testsuite/23_containers/map/allocator/init-list.cc: New.
	* testsuite/23_containers/map/allocator/move_assign.cc (test03): New.
	* testsuite/23_containers/multimap/allocator/copy_assign.cc
	(test03): New.
	* testsuite/23_containers/multimap/allocator/init-list.cc: New.
	* testsuite/23_containers/multimap/allocator/move_assign.cc
	(test03): New.
	* testsuite/23_containers/multiset/allocator/copy_assign.cc
	(test03): New.
	* testsuite/23_containers/multiset/allocator/init-list.cc: New.
	* testsuite/23_containers/multiset/allocator/move_assign.cc
	(test03): New.
	* testsuite/23_containers/set/allocator/copy_assign.cc (test03): New.
	* testsuite/23_containers/set/allocator/init-list.cc: New.
	* testsuite/23_containers/set/allocator/move_assign.cc (test03): New.

From-SVN: r215568
2014-09-24 19:55:35 +00:00
Jonathan Wakely 48e968a720 gnu.ver: Adjust basic_ostream exports.
* config/abi/pre/gnu.ver: Adjust basic_ostream exports.
	* include/std/istream (basic_iostream(basic_iostream&&)): Pass *this
	to ostream constructor.
	* include/std/ostream (basic_ostream(basic_iostream*)): Change to take
	parameter by reference, to avoid ambiguity.
	* testsuite/27_io/basic_ostream/cons/char/null.cc: New.

From-SVN: r215510
2014-09-23 14:17:42 +01:00
Jonathan Wakely 7666d649f8 Include <bits/uses_allocator.h> in <stack> and <queue>.
* include/bits/stl_queue.h: Include missing header.
	* include/bits/stl_stack.h: Likewise.
	* testsuite/23_containers/priority_queue/requirements/
	uses_allocator.cc: New.
	* testsuite/23_containers/queue/requirements/uses_allocator.cc: New.
	* testsuite/23_containers/stack/requirements/uses_allocator.cc: New.

From-SVN: r215470
2014-09-22 17:01:53 +01:00
Jonathan Wakely 726d31362a mutex (try_lock): Do not swallow exceptions.
* include/std/mutex (try_lock): Do not swallow exceptions.
	* testsuite/30_threads/try_lock/4.cc: Fix test.

From-SVN: r215467
2014-09-22 15:54:35 +01:00
Jonathan Wakely 9b81754858 Make streams movable and swappable.
PR libstdc++/54316
	PR libstdc++/53626
	* config/abi/pre/gnu.ver: Add new exports.
	* config/io/basic_file_stdio.h (__basic_file): Support moving and
	swapping.
	* include/bits/basic_ios.h (basic_ios::move, basic_ios::swap):
	Likewise.
	* include/bits/ios_base.h (ios_base::_M_move, ios_base::_M_swap):
	Likewise.
	* include/bits/fstream.tcc (basic_filebuf): Likewise.
	* include/bits/move.h (__exchange): Define for C++11 mode.
	* include/ext/stdio_filebuf.h (stdio_filebuf): Support moving and
	swapping.
	* include/ext/stdio_sync_filebuf.h (stdio_sync_filebuf): Likewise.
	* include/std/fstream (basic_filebuf, basic_ifstream, basic_ofstream,
	basic_fstream): Likewise.
	* include/std/ios: Remove whitespace.
	* include/std/istream (basic_istream, basic_iostream): Support moving
	and swapping.
	* include/std/ostream (basic_ostream): Likewise.
	* include/std/sstream (basic_stringbuf, basic_istringstream,
	basic_ostringstream, basic_stringstream): Likewise.
	* include/std/streambuf (basic_streambuf): Do not default copy
	constructor and assignment on first declaration.
	* include/std/utility (exchange): Forward to __exchange.
	* testsuite/27_io/basic_filebuf/cons/char/copy_neg.cc: New.
	* src/c++11/Makefile.am: Add stream-related files.
	* src/c++11/Makefile.in: Regenerate.
	* src/c++11/ext11-inst.cc (stdio_filebuf, stdio_sync_filebuf):
	New file for explicit instantiation definitions.
	* src/c++11/ios.cc: Move from src/c++98 to here.
	(ios_base::_M_move, ios_base::_M_swap): Define.
	* src/c++11/ios-inst.cc: Move from src/c++98 to here.
	* src/c++11/iostream-inst.cc: Likewise.
	* src/c++11/istream-inst.cc: Likewise.
	* src/c++11/ostream-inst.cc: Likewise.
	* src/c++11/sstream-inst.cc: Likewise.
	* src/c++11/streambuf-inst.cc: Likewise.
	* src/c++98/Makefile.am: Remove stream-related files.
	* src/c++98/Makefile.in: Regenerate.
	* src/c++98/ext-inst.cc (stdio_filebuf): Remove explicit
	instantiations.
	* src/c++98/misc-inst.cc (stdio_sync_filebuf): Likewise.
	* src/c++98/ios-inst.cc: Move to src/c++11/.
	* src/c++98/ios.cc: Move to src/c++11/.
	* src/c++98/iostream-inst.cc: Likewise.
	* src/c++98/istream-inst.cc: Likewise.
	* src/c++98/ostream-inst.cc: Likewise.
	* src/c++98/sstream-inst.cc: Likewise.
	* src/c++98/streambuf-inst.cc: Likewise.
	* testsuite/27_io/basic_filebuf/cons/char/copy_neg.cc: New.
	* testsuite/27_io/basic_fstream/cons/move.cc: New.
	* testsuite/27_io/basic_fstream/assign/1.cc: New.
	* testsuite/27_io/basic_ifstream/cons/move.cc: New.
	* testsuite/27_io/basic_ifstream/assign/1.cc: New.
	* testsuite/27_io/basic_istringstream/assign/1.cc: New.
	* testsuite/27_io/basic_istringstream/cons/move.cc: New.
	* testsuite/27_io/basic_ofstream/cons/move.cc: New.
	* testsuite/27_io/basic_ofstream/assign/1.cc: New.
	* testsuite/27_io/basic_ostringstream/assign/1.cc: New.
	* testsuite/27_io/basic_ostringstream/cons/move.cc: New.
	* testsuite/27_io/basic_stringstream/assign/1.cc: New.
	* testsuite/27_io/basic_stringstream/cons/move.cc: New.

From-SVN: r215463
2014-09-22 14:34:09 +01:00
Jonathan Wakely 4564acc36f regex.h (basic_regex): Rename _Ch_typeraits template parameters to _Ch_traits.
* include/bits/regex.h (basic_regex): Rename _Ch_typeraits template
	parameters to _Ch_traits.

From-SVN: r215261
2014-09-15 11:57:51 +01:00
Jonathan Wakely b6f866946b deque (__gnu_debug::deque): Make base class C++11 allocator aware.
* include/debug/deque (__gnu_debug::deque): Make base class C++11
	allocator aware.

From-SVN: r215223
2014-09-12 15:06:50 +01:00
Jonathan Wakely bc5022d011 re PR libstdc++/59603 (std::random_shuffle tries to swap element with itself)
PR libstdc++/59603
	* include/bits/stl_algo.h (random_shuffle): Prevent self-swapping.
	* testsuite/25_algorithms/random_shuffle/59603.cc: New.

From-SVN: r215219
2014-09-12 14:30:35 +01:00
Jonathan Wakely 8aed2f2f63 re PR libstdc++/63219 (Superfluous template parameter in match_result::format overload)
PR libstdc++/63219
	* include/bits/regex.h (match_results::format): Remove stray template
	parameter.
	* include/bits/regex_compiler.h (_RegexTranslator::_RegexTranslator):
	Remove parameter name to avoid -Wunused-parameter warning.
	* include/bits/regex_executor.h (_State_info::_State_info): Reorder
	mem-initializers to avoid -Wreorder warning.
	* include/bits/regex_executor.tcc (_Executor::_M_word_boundary):
	Remove parameter name to avoid -Wunused-parameter warning.
	* include/bits/regex_scanner.tcc (_Scanner::_M_advance): Add braces
	to avoid -Wempty-body warning when not in debug mode.

From-SVN: r215160
2014-09-11 11:01:20 +01:00
Jonathan Wakely fd18c76ac8 Make std::deque meet C++11 allocator requirements.
* include/bits/deque.tcc (deque::operator=(const deque&)): Handle
	allocator propagation.
	(deque::emplace_front, deque::emplace_back): Use allocator traits.
	(deque::_M_push_back_aux, deque::_M_push_front_aux): Likewise.
	(deque::_M_pop_back_aux, deque::_M_pop_front_aux): Likewise.
	* include/bits/stl_deque.h (__deque_buf_size): Add constexpr.
	(_Deque_iterator): Handle allocators with custom pointers.
	(_Deque_base): Likewise. Use allocator traits.
	(deque): Likewise. Add allocator-extended constructors.
	(deque::_M_move_assign1, deque::_M_move_assign2): Implement move
	assignment via tag dispatching.
	(deque::_M_replace_map): Replace existing data.
	* include/debug/deque (deque): Add allocator-extended constructors.
	* include/profile/deque (deque): Likewise.
	* testsuite/23_containers/deque/allocator/copy.cc: New.
	* testsuite/23_containers/deque/allocator/copy_assign.cc: New.
	* testsuite/23_containers/deque/allocator/ext_ptr.cc: New.
	* testsuite/23_containers/deque/allocator/minimal.cc: New.
	* testsuite/23_containers/deque/allocator/move.cc: New.
	* testsuite/23_containers/deque/allocator/move_assign-2.cc: New.
	* testsuite/23_containers/deque/allocator/move_assign.cc: New.
	* testsuite/23_containers/deque/allocator/noexcept.cc: New.
	* testsuite/23_containers/deque/allocator/swap.cc: New.
	* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/52591.cc: Test both the propagating
	and always-equal cases.

From-SVN: r215090
2014-09-09 18:29:32 +01:00
François Dumont da27f5567c hashtable_policy.h (_Prime_rehash_policy): Constructor noexcept qualified.
2014-09-06  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/hashtable_policy.h (_Prime_rehash_policy): Constructor
	noexcept qualified.
	(_Hash_code_base<>): All specialization default constructible if
	possible.
	(_Hashtable_base<>): Likewise.
	* include/bits/hashtable.h (_Hashtable<>()): Implementation defaulted.
	* include/bits/unordered_map.h (unordered_map<>::unordered_map()): New,
	implementation defaulted.
	(unordered_multimap<>::unordered_multimap()): Likewise.
	* include/bits/unordered_set.h
	(unordered_set<>::unordered_set()): Likewise.
	(unordered_multiset<>::unordered_multiset()): Likewise.
	* include/debug/unordered_map: Likewise.
	* include/debug/unordered_set: Likewise.
	* testsuite/23_containers/unordered_map/allocator/noexcept.cc
	(test04()): New.
	* testsuite/23_containers/unordered_multimap/allocator/noexcept.cc
	(test04()): New.
	* testsuite/23_containers/unordered_set/allocator/noexcept.cc
	(test04()): New.
	* testsuite/23_containers/unordered_multiset/allocator/noexcept.cc
	(test04()): New.

From-SVN: r214986
2014-09-06 07:38:48 +00:00
Jonathan Wakely fa794dc63e complex (complex): Define copy constructor and assignment operator as defaulted.
* include/std/complex (complex): Define copy constructor and
	assignment operator as defaulted. Improve Doxygen comments.

From-SVN: r214736
2014-08-29 17:28:19 +01:00
Jonathan Wakely 3cd4f356e9 re PR libstdc++/62159 (Missing headers for freestanding implementation)
PR libstdc++/62159
	* include/Makefile.am (install-freestanding-headers): Add missing
	C++11 headers.
	* include/Makefile.in: Regenerate.

From-SVN: r214580
2014-08-27 18:33:42 +01:00
Jonathan Wakely c6b3f349f5 re PR libstdc++/61841 (broken std::thread on Hurd)
PR libstdc++/61841
	* include/std/thread (thread::_M_start_thread): Declare new overload.
	(thread::thread<_Callable, _Args...>): Call new overload with an
	explicit reference to pthread_create.
	* src/c++11/thread.cc (thread::_M_start_thread): Add new overload.
	* config/abi/pre/gnu.ver: Export new function.

From-SVN: r213922
2014-08-13 19:40:10 +01:00
Sylvestre Ledru 07ec100911 profiler_hash_func.h: Fix a comment typo
2014-08-12  Sylvestre Ledru  <sylvestre@debian.org>

        * include/profile/impl/profiler_hash_func.h: Fix a comment typo

From-SVN: r213914
2014-08-13 16:28:39 +00:00
Paolo Carlini 429e4fdebf 2014-08-13 Paolo Carlini <paolo.carlini@oracle.com>
* Fix thinko in the last commit.

From-SVN: r213908
2014-08-13 11:56:45 +00:00
Paolo Carlini a3ee88517c re PR libstdc++/62118 (cases under libstdc++-v3/testsuite/ext/ failed on aarch64/arm)
2014-08-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/62118
	* include/ext/random.tcc (uniform_on_sphere_helper<2, _RealType>::
	operator()): Use std::hypot only when _GLIBCXX_USE_C99_MATH_TR1.

From-SVN: r213906
2014-08-13 11:24:35 +00:00
Jonathan Wakely caff45a635 * include/bits/basic_string.h (getline): Declare inline.
From-SVN: r213873
2014-08-12 16:48:23 +01:00
Jonathan Wakely 191736612d basic_string.h (getline): Qualify call to prevent ADL and add overloads for rvalue streams.
* include/bits/basic_string.h (getline): Qualify call to prevent ADL
	and add overloads for rvalue streams.
	* testsuite/21_strings/basic_string/inserters_extractors/char/12.cc:
	New.
	* testsuite/21_strings/basic_string/inserters_extractors/wchar_t/12.cc:
	New.

From-SVN: r213869
2014-08-12 16:19:53 +01:00
Ulrich Drepper 83a4216dd2 random.tcc (uniform_on_sphere_helper): Define.
* include/ext/random.tcc (uniform_on_sphere_helper): Define.
        (uniform_on_sphere_distribution::operator()): Use the new helper
        class for the implementation.

        * testsuite/ext/random/uniform_on_sphere_distribution/operators/
        equal.cc: Remove bogus part of comment.
        * testsuite/ext/random/uniform_on_sphere_distribution/operators/
        inequal.cc: Likewise.
        * testsuite/ext/random/uniform_on_sphere_distribution/operators/
        serialize.cc: Add check to verify result of serialzation and
        deserialization.
        * testsuite/ext/random/uniform_on_sphere_distribution/operators/
        generate.cc: New file.

From-SVN: r213779
2014-08-09 17:56:57 +00:00
Paolo Carlini 6a6bdc3d09 invoke.texi ([Wnarrowing]): Update for non-constants in C++11.
2014-08-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* doc/invoke.texi ([Wnarrowing]): Update for non-constants in C++11.

gcc/cp
2014-08-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* typeck2.c (check_narrowing): Add tsubst_flags_t parameter, change
	return type to bool; in C++11 for constants give errors, not pedwarns.
	* cp-tree.h (check_narrowing): Adjust declaration.
	* call.c (convert_like_real): Update calls.
	* semantics.c (finish_compound_literal): Likewise.

gcc/testsuite
2014-08-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp0x/Wnarrowing1.C: Adjust for errors.
	* g++.dg/cpp0x/enum29.C: Adjust.

/libstdc++-v3
2014-08-09  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/ext/pod_char_traits.h (char_traits<__gnu_cxx::
	character<_Value, _Int, _St> >::eof): Fix vs narrowing conversion.

From-SVN: r213776
2014-08-09 08:58:33 +00:00
François Dumont 013078982d re PR libstdc++/61667 (setting max_load_factor of unordered_map cause buckets shrink)
2014-08-09  François Dumont  <fdumont@gcc.gnu.org>

	PR libstdc++/61667
	* include/bits/hashtable.h (_Hashtable<>::__rehash_policy): Use
	_M_need_rehash to initialize the rehash policy and check if a rehash is
	needed.
	* testsuite/23_containers/unordered_map/modifiers/61667.cc: New.

From-SVN: r213775
2014-08-09 08:00:59 +00:00
Jonathan Wakely db0b7db338 future (__location_invariant): Move specializations after preprocessor condition.
* include/std/future (__location_invariant): Move specializations
	after preprocessor condition.

From-SVN: r213744
2014-08-07 23:54:53 +01:00
Jonathan Wakely 4e48c10968 future (_State_baseV2::_M_set_result): Pass pointers to _M_do_set.
* include/std/future (_State_baseV2::_M_set_result): Pass pointers to
	_M_do_set.
	(_State_baseV2::_M_do_set): Change parameters to pointers.
	(_State_baseV2::_Setter): Change _M_arg from reference to pointer.
	(_State_baseV2::__setter): Initialize _Setter with pointers.
	(_State_baseV2::__setter(promise<void>*)): Remove overload.
	(promise::set_value, promise::set_exception): Pass setter directly
	to _M_set_result.
	(_State_baseV2::_Task_setter): Add template parameter for callable
	type and replace std::function member with pointer to that type.
	Change _M_result member from reference to pointer.
	(_State_baseV2::_S_task_setter): Change parameter to lvalue reference
	and initialize _Task_setter with pointers.
	(__location_invariant): Specialize for _Setter and _Task_setter.

From-SVN: r213737
2014-08-07 21:13:52 +01:00
Jonathan Wakely d0ef19a0b2 stl_list.h (_List_base::_List_base(_List_base&&)): Optimize.
* include/bits/stl_list.h (_List_base::_List_base(_List_base&&)):
	Optimize.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Adjust dg-error line number.
	* 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.

From-SVN: r213716
2014-08-07 18:25:13 +01:00
Jonathan Wakely f4081d133f re PR libstdc++/61947 (Ambiguous calls when constructing std::tuple)
PR libstdc++/61947
	* include/std/tuple (_Head_base): Use allocator_arg_t parameters to
	disambiguate unary constructors.
	(_Tuple_impl): Pass allocator_arg_t arguments.
	* testsuite/20_util/tuple/61947.cc: New.
	* testsuite/20_util/uses_allocator/cons_neg.cc: Adjust dg-error line.

From-SVN: r213221
2014-07-29 18:30:34 +01:00
Jonathan Wakely aec20dcf39 re PR libstdc++/61946 (rope construction, passing allocator referenct without const)
PR libstdc++/61946
	* include/ext/rope (rope::rope(char_producer<_CharT>*, size_t, bool,
	const allocator_type&)): Pass non-const allocator to
	_S_new_RopeFunction.
	* testsuite/ext/rope/61946.cc: New.

From-SVN: r213220
2014-07-29 18:30:25 +01:00
Ed Smith-Rowland 1c4ff014fe PR libstdc++/60037 - SIGFPE in std::generate_canonical<unsigned int...>
2014-07-29  Ed Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/60037 - SIGFPE in std::generate_canonical<unsigned int...>
	* include/bits/random.h (_Adaptor): static_assert for non floating-point
	result type.
	* include/bits/random.tcc (generate_canonical): Ditto.
	* include/ext/random.tcc (hypergeometric_distribution::operator()):
	Use double as a rng result type.
	* testsuite/26_numerics/random/pr60037-neg.cc: New.
	* testsuite/ext/random/hypergeometric_distribution/pr60037.cc: New.

From-SVN: r213207
2014-07-29 14:56:45 +00:00
Ed Smith-Rowland 0a9f0ecb4c string_view: Make the literal operators constexpr like the ctors they call.
2014-07-25  Ed Smith-Rowland  <3dw4rd@verizon.net>

	* include/experimental/string_view: Make the literal operators
	constexpr like the ctors they call.

From-SVN: r213037
2014-07-25 03:47:46 +00:00
Paolo Carlini 026ae646e7 random: Minor formatting and cosmetic tweaks.
2014-07-16  Paolo Carlini  <paolo.carlini@oracle.com>

	* include/ext/random: Minor formatting and cosmetic tweaks.
	(uniform_on_sphere_distribution<>::operator==
	(const uniform_on_sphere_distribution&,
	const uniform_on_sphere_distribution&)): Compare the _M_nds.
	(uniform_on_sphere_distribution<>::reset): Reset _M_nd.
	(operator!=(const uniform_on_sphere_distribution&,
	const uniform_on_sphere_distribution&)): Adjust.
	* include/ext/random.tcc: Minor cosmetc tweaks.

From-SVN: r212674
2014-07-16 15:47:26 +00:00
Tim Shen 4228f9328c re PR libstdc++/61720 (std::regex_search matches incorrectly)
PR libstdc++/61720
	* include/bits/regex_executor.tcc (_Executor<>::_M_main_dispatch):
	Clear match queue for next use.
	* testsuite/28_regex/algorithms/regex_search/61720.cc: New file.

From-SVN: r212539
2014-07-15 04:28:51 +00:00
Ulrich Drepper b40d9361f9 random.tcc: Unfortunately more fixes for operator>> and operator<< for...
* include/ext/random.tcc: Unfortunately more fixes for
	operator>> and operator<< for uniform_on_sphere_distribution.

From-SVN: r212517
2014-07-14 12:09:30 +00:00
Ulrich Drepper 5c8efaf2fb random.tcc: Fix operator>> and operator<< for uniform_on_sphere_distribution.
* include/ext/random.tcc: Fix operator>> and operator<< for
	uniform_on_sphere_distribution.

From-SVN: r212496
2014-07-13 16:43:01 +00:00
Ulrich Drepper 863a2c7ecc random: Add uniform_on_sphere_distribution definition.
2014-07-12  Ulrich Drepper  <drepper@gmail.com>

	* include/ext/random: Add uniform_on_sphere_distribution definition.
	* include/ext/random.tcc: Add out-of-band member function definitions
	for uniform_on_sphere_distribution.
	* testsuite/ext/random/uniform_on_sphere_distribution/
	cons/default.cc: New file.
	* testsuite/ext/random/uniform_on_sphere_distribution/
	operators/equal.cc: New file.
	* testsuite/ext/random/uniform_on_sphere_distribution/
	operators/inequal.cc: New file.
	* testsuite/ext/random/uniform_on_sphere_distribution/
	operators/serialize.cc: New file.

From-SVN: r212492
2014-07-13 11:07:44 +00:00
Edward Smith-Rowland 8daac7749f Add the logistic_distribution as an extension.
2014-07-11  Edward Smith-Rowland  <3dw4rd@verizon.net>

	Add the logistic_distribution as an extension.
	* include/ext/random: Add the logistic_distribution.
	* include/ext/random.tcc: Add the logistic_distribution.
	* testsuite/ext/random/logistic_distribution/cons/parms.cc: New.
	* testsuite/ext/random/logistic_distribution/cons/default.cc: New.
	* testsuite/ext/random/logistic_distribution/requirements/typedefs.cc:
	New.
	* testsuite/ext/random/logistic_distribution/operators/inequal.cc: New.
	* testsuite/ext/random/logistic_distribution/operators/equal.cc: New.
	* testsuite/ext/random/logistic_distribution/operators/serialize.cc:
	New.

From-SVN: r212476
2014-07-12 01:32:20 +00:00
Jonathan Wakely 7757d79bfc any (any::_Manager_alloc::_Data): Reorder tuple members to simplify pretty printing.
* include/experimental/any (any::_Manager_alloc::_Data): Reorder
	tuple members to simplify pretty printing.
	(any::_Manager_alloc::_Data::_M_construct): Fix uses-allocator
	construction.
	* testsuite/experimental/any/cons/4.cc: New.

From-SVN: r212435
2014-07-10 19:08:35 +01:00
Jonathan Wakely b3771d3f6f allocated_ptr.h (__allocated_ptr::operator=): Add missing return.
* include/bits/allocated_ptr.h (__allocated_ptr::operator=): Add
	missing return.
	* include/experimental/any: Remove unused header.
	* include/std/functional (_Maybe_wrap_member_pointer): Fix comments.
	* testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error.
	* testsuite/util/testsuite_regex.h: Move include guard.

From-SVN: r212360
2014-07-08 14:22:14 +01:00
Tim Shen 5bcb66dffa re PR testsuite/61061 (FAIL: g++.dg/inherit/covariant7.C)
PR libstdc++/61061
	PR libstdc++/61582
	* include/bits/regex_automaton.h (_NFA<>::_M_insert_state): Add
	a NFA state limit. If it's exceeded, regex_constants::error_space
	will be throwed.
	* include/bits/regex_automaton.tcc (_StateSeq<>::_M_clone): Use
	map (which is sparse) instead of vector. This reduce n times clones'
	cost from O(n^2) to O(n).
	* include/std/regex: Add map dependency.
	* testsuite/28_regex/algorithms/regex_match/ecma/char/61601.cc: New
	testcase.

From-SVN: r212185
2014-07-01 03:05:45 +00:00
Tim Shen ad9ec7b3c5 re PR libstdc++/61424 (std::regex matches right to left, not leftmost longest)
PR libstdc++/61424
	* include/bits/regex.tcc (__regex_algo_impl<>): Use DFS for ECMAScript,
	not just regex containing back-references.
	* include/bits/regex_compiler.tcc (_Compiler<>::_M_disjunction):
	exchange _M_next and _M_alt for alternative operator,
	making matching from left to right.
	* include/bits/regex_executor.h (_State_info<>::_M_get_sol_pos):
	Add position tracking fom DFS.
	* include/bits/regex_executor.tcc (_Executor<>::_M_main_dispatch,
	_Executor<>::_M_dfs): Likewise.
	* include/bits/regex_scanner.h: Remove unused enum entry.
	* testsuite/28_regex/algorithms/regex_search/61424.cc: New
	testcase from PR.

From-SVN: r212184
2014-07-01 02:10:31 +00:00
Jonathan Wakely 906314419f shared_ptr_base.h (__shared_ptr::_Deleter): Fix parameter type.
* include/bits/shared_ptr_base.h (__shared_ptr::_Deleter): Fix
	parameter type.

From-SVN: r212027
2014-06-26 13:43:59 +01:00
Jonathan Wakely b925bf594a Makefile.am: Add new header.
* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/allocated_ptr.h (__allocated_ptr, __allocate_guarded):
	New RAII utilities for working with allocators.
	* include/bits/shared_ptr_base.h (_Sp_counted_deleter): Define
	__allocator_type typedef and use new __allocated_ptr type.
	(_Sp_counted_ptr_inplace): Likewise.
	(__shared_count::__shared_count, __shared_ptr::__shared_ptr): Use
	__allocate_guarded to to simplify exception handling.
	* include/experimental/any (any::_Manager_alloc::_S_alloc): Likewise.
	* include/std/future (_Result_alloc::_M_destroy): Likewise.
	(_Result_alloc::_S_allocate_result): Likewise.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line number.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.
	* testsuite/20_util/shared_ptr/creation/no_rtti.cc: New.
	* testsuite/20_util/shared_ptr/creation/alloc.cc: Test allocator
	with fancy pointer.
	* testsuite/30_threads/promise/cons/alloc.cc: Likewise.

From-SVN: r211996
2014-06-25 21:54:46 +01:00
Jonathan Wakely 484dc5996f alloc_traits.h (__alloc_rebind): Define alias template.
* include/bits/alloc_traits.h (__alloc_rebind): Define alias template.
	* include/bits/forward_list.h (_Fwd_list_base): Use __alloc_rebind.
	* include/bits/hashtable_policy.h (_Insert_base, _Hashtable_alloc):
	Likewise.
	* include/ext/alloc_traits.h: Fix comment.

From-SVN: r211995
2014-06-25 21:54:34 +01:00
Jonathan Wakely 3fa591d4b4 functexcept.h (__throw_out_of_range_fmt): Change attribute to __gnu_printf__ archetype to prevent warnings for "%zu".
* include/bits/functexcept.h (__throw_out_of_range_fmt): Change
	attribute to __gnu_printf__ archetype to prevent warnings for "%zu".
	* include/bits/locale_facets_nonio.tcc (time_get::do_get_weekday):
	Remove unused typedef.
	(time_get::do_get_monthname): Likewise.
	* include/bits/stl_tree.h: Add system_header pragma.
	* include/ext/stdio_sync_filebuf.h (stdio_sync_filebuf::file): Remove
	redundant const-qualifier.
	* include/std/complex (complex::__rep): Use _GLIBCXX_CONSTEXPR macro
	instead of _GLIBCXX_USE_CONSTEXPR.

From-SVN: r211951
2014-06-24 16:44:17 +01:00
Jonathan Wakely 7ce56fc845 any (any_v1): Rename namespace to fundamentals_v1.
* include/experimental/any (any_v1): Rename namespace to
	fundamentals_v1. Change string returned by bad_any_cast::what().
	* include/experimental/optional (fundamentals_v1): Add namespace.
	* include/experimental/string_view (fundamentals_v1): Likewise.
	* testsuite/experimental/any/typedefs.cc: New.
	* testsuite/experimental/optional/typedefs.cc: New.
	* testsuite/experimental/string_view/typedefs.cc: New.

From-SVN: r211920
2014-06-23 23:12:31 +01:00
Jonathan Wakely 83387bbd28 parse_numbers.h (_Number_help): Fix divide-by-zero.
* include/bits/parse_numbers.h (_Number_help): Fix divide-by-zero.
	* include/std/chrono (_Checked_integral_constant): Allow zero.
	* testsuite/20_util/duration/literals/values.cc: Test non-positive
	values and digit separators.

From-SVN: r211890
2014-06-23 12:30:32 +01:00
Jonathan Wakely fb3bc97798 any (any_cast): Combine duplicate doxygen comments.
* include/experimental/any (any_cast): Combine duplicate doxygen
	comments.
	* include/experimental/string_view (basic_string_view): Update
	doxygen comment.
	* include/std/bitset (bitset): Move to Doxygen 'utilities' group.
	* include/tr2/dynamic_bitset (_Bool2UChar): Remove unused templates.
	(dynamic_bitset): Improve Doxygen comments.
	* include/tr2/dynamic_bitset.tcc (operator>>): Improve Doxygen
	comment.

From-SVN: r211672
2014-06-14 21:43:07 +01:00
Jonathan Wakely 10d43d2fb4 api.xml: Link to more recent API docs.
* doc/xml/api.xml: Link to more recent API docs.
	* include/bits/allocator.h: Fix link in doxygen comment.
	* include/bits/char_traits.h: Likewise.
	* include/bits/ios_base.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/stl_set.h: Likewise.
	* include/bits/unordered_map.h: Likewise.
	* include/bits/unordered_set.h: Likewise.
	* include/ext/mt_allocator.h: Likewise.
	* include/std/fstream: Likewise.
	* include/std/iosfwd: Likewise.
	* include/std/ostream: Likewise.
	* include/std/sstream: Likewise.
	* include/std/streambuf: Likewise.
	* doc/html/*: Regenerate.

From-SVN: r211671
2014-06-14 21:22:10 +01:00