Commit Graph

8565 Commits

Author SHA1 Message Date
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 aa1986fac1 mutex_extensions_neg.cc: Adjust dg-error.
2014-12-20  François Dumont  <fdumont@gcc.gnu.org>

	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error.

From-SVN: r218990
2014-12-20 16:09:45 +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 189486b858 Fix duplicate symbol errors in Darwin bootstrap.
* src/c++98/locale-inst.cc (__add_grouping, __pad, __int_to_char):
	Only compile for old ABI.

From-SVN: r218984
2014-12-20 00:19:40 +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
Jakub Jelinek 7e2ac29ecb gnu.ver (CXXABI_1.3.9): Export not just _Zd[la]Pvm...
* config/abi/pre/gnu.ver (CXXABI_1.3.9): Export not just
	_Zd[la]Pvm, but also _Zd[la]Pv[jy] to cover other std::size_t
	manglings.

From-SVN: r218785
2014-12-16 18:42:24 +01:00
Jason Merrill 47830a4d38 gnu-versioned-namespace.ver: And other size_t manglings.
* config/abi/pre/gnu-versioned-namespace.ver: And other size_t
	manglings.

From-SVN: r218784
2014-12-16 12:21:42 -05:00
Jason Merrill 4244b840bd gnu-versioned-namespace.ver: Export _ZdlPvm and _ZdaPvm.
* config/abi/pre/gnu-versioned-namespace.ver: Export _ZdlPvm and
	_ZdaPvm.

From-SVN: r218781
2014-12-16 10:48:58 -05:00
Jason Merrill 20b06addf9 N3778: Sized Deallocation
N3778: Sized Deallocation
gcc/c-family/
	* c.opt (-fsized-deallocation, -Wc++14-compat): New.
	(-Wsized-deallocation): New.
	* c-opts.c (c_common_post_options): -fsized-deallocation defaults
	to on in C++14 and up.
gcc/cp/
	* call.c (non_placement_deallocation_fn_p): A global sized
	operator delete is not a usual deallocation function until C++14.
	(build_op_delete_call): Choose the global sized op delete if we
	know the size.
	* cp-tree.h: Declare non_placement_deallocation_fn_p.
	(enum cp_tree_index): Remove CPTI_GLOBAL_DELETE_FNDECL.
	(global_delete_fndecl): Remove.
	* decl.c (cxx_init_decl_processing): Also declare sized op deletes.
	(grok_op_properties): Warn about sized dealloc without the flag.
	* init.c (build_builtin_delete_call): Remove.
	(build_vec_delete_1, build_delete): Don't call it.
	* decl2.c (maybe_warn_sized_delete): New.
	(cp_write_global_declarations): Call it.
libstdc++-v3/
	* libsupc++/del_ops.cc: New.
	* libsupc++/del_opvs.cc: New.
	* libsupc++/Makefile.am: Add them.
	* libsupc++/Makefile.in: Regenerate.
	* config/abi/pre/gnu.ver: Export _ZdlPvm and _ZdaPvm.

From-SVN: r218755
2014-12-15 13:31:40 -05: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 8f596ff51a re PR libstdc++/64241 (make_exception_ptr returns garbage with -fno-exceptions)
PR libstdc++/64241
	* libsupc++/exception_ptr.h: Return empty object when exceptions are
	disabled.
	* testsuite/18_support/exception_ptr/64241.cc: New.

From-SVN: r218675
2014-12-12 15:10:08 +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
Kyrylo Tkachov c71c975fe6 [libstdc++][testsuite] Mark as UNSUPPORTED tests that don't fit into tiny memory model
* testsuite/lib/libstdc++.exp: Include target-utils.exp.
	(v3_target_compile): Check if test is unsupported.
	(v3_target_compile_as_c): Likewise.

From-SVN: r218661
2014-12-12 09:36:35 +00:00
Jason Merrill 94a073b251 Remove N3639 "array of runtime length" from -std=c++14.
gcc/cp/
	* decl.c (compute_array_index_type): VLAs are not part of C++14.
	(create_array_type_for_decl, grokdeclarator): Likewise.
	* lambda.c (add_capture): Likewise.
	* pt.c (tsubst): Likewise.
	* rtti.c (get_tinfo_decl): Likewise.
	* semantics.c (finish_decltype_type): Likewise.
	* typeck.c (cxx_sizeof_or_alignof_type): Likewise.
	(cp_build_addr_expr_1): Likewise.
	* init.c (build_vec_init): Don't throw bad_array_length.
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_runtime_arrays if
	we aren't complaining about VLAs.
libstdc++-v3/
	* libsupc++/new (bad_array_length): Move...
	* bad_array_length.cc: ...here.
	* cxxabi.h, eh_aux_runtime.cc (__cxa_throw_bad_array_new_length): Also
	move to bad_array_length.cc.

	* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_runtime_arrays if
	we aren't complaining about VLAs.

From-SVN: r218655
2014-12-11 22:49:13 -05:00
Jonathan Wakely b8c555ac7c 3.cc: Only use a thread_local when __cxa_thread_atexit_impl is available.
* testsuite/30_threads/condition_variable/members/3.cc: Only use
	a thread_local when __cxa_thread_atexit_impl is available.

From-SVN: r218638
2014-12-11 17:58:22 +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
Tim Shen 00d6d5b1e7 Fix ChangeLog format.
From-SVN: r218444
2014-12-06 11:31:12 +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 28fe2ab37c re PR libstdc++/64161 (bootstrap error: condition_variable.cc:134:7: error: 'atexit' is not a member of 'std')
PR libstdc++/64161
	* src/c++11/condition_variable.cc: Include <cstdlib>.

From-SVN: r218300
2014-12-03 01:34:03 +00:00
Jonathan Wakely e3376050fc status_cxx2011.xml: Update.
* doc/xml/manual/status_cxx2011.xml: Update.
	* doc/xml/manual/status_cxx2014.xml: Update.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r218270
2014-12-02 13:26:18 +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 565aed1a1e * config/abi/pre/gnu.ver: Fix ios_base::failure exports.
From-SVN: r218189
2014-11-30 12:51:42 +00:00
Jonathan Wakely 38dbb2a53f locale_init.cc (locale::_Impl::_Impl(size_t)): Use new-initializer instead of loop.
* src/c++98/locale_init.cc (locale::_Impl::_Impl(size_t)): Use
	new-initializer instead of loop.
	* src/c++98/localename.cc (locale::_Impl::_Impl(const char*, size_t)):
	Likewise.

From-SVN: r218184
2014-11-29 22:58:38 +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
Jonathan Wakely 77262e4212 XFAIL 27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc on Solaris (PR libstd++/64054)
PR libstdc++/64054
	* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
	XFAIL execution on *-*-solaris*.

Co-Authored-By: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>

From-SVN: r218081
2014-11-26 13:22:27 +00:00
Tom de Vries 6a848e9de1 Ensure single 'UNSUPPORTED: prettyprinters.exp' message
2014-11-25  Tom de Vries  <tom@codesourcery.com>

	* testsuite/libstdc++-prettyprinters/prettyprinters.exp: Add missing
	dg-finish.  Only print unsupported message once.

From-SVN: r218060
2014-11-25 20:30:20 +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
H.J. Lu a699d67255 Always use PIC option with -shared in libtool
Libtool needs to pass PIC option -shared when creating shared object to
link regular object files with slim-lto archive.

	PR bootstrap/63784
	* libtool.m4: Add $pic_flag with -shared.

boehm-gc/

	PR bootstrap/63784
	* configure: Regenerated.

gcc/

	PR bootstrap/63784
	* configure: Regenerated.

libatomic/

	PR bootstrap/63784
	* configure: Regenerated.

libbacktrace/

	PR bootstrap/63784
	* configure: Regenerated.

libcc1/

	PR bootstrap/63784
	* configure: Regenerated.

libcilkrts/

	PR bootstrap/63784
	* configure: Regenerated.

libffi/

	PR bootstrap/63784
	* configure: Regenerated.

libgfortran/

	PR bootstrap/63784
	* configure: Regenerated.

libgomp/

	PR bootstrap/63784
	* configure: Regenerated.

libitm/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/

	PR bootstrap/63784
	* configure: Regenerated.

libjava/classpath/

	PR bootstrap/63784
	* configure: Regenerated.

libobjc/

	PR bootstrap/63784
	* configure: Regenerated.

libquadmath/

	PR bootstrap/63784
	* configure: Regenerated.

libsanitizer/

	PR bootstrap/63784
	* configure: Regenerated.

libssp/

	PR bootstrap/63784
	* configure: Regenerated.

libstdc++-v3/

	PR bootstrap/63784
	* configure: Regenerated.

libvtv/

	PR bootstrap/63784
	* configure: Regenerated.

lto-plugin/

	PR bootstrap/63784
	* configure: Regenerated.

From-SVN: r217937
2014-11-21 08:49:17 -08:00
Ville Voutilainen 75bda2e813 re PR c++/63959 (G++ misreports volatile int as trivially copyable)
PR c++/63959
	* tree.c (trivially_copyable_p): Check for CP_TYPE_VOLATILE_P.

From-SVN: r217893
2014-11-20 16:51:04 -05:00
Marc Glisse bb59f396f8 re PR libstdc++/43622 (Incomplete C++ library support for __float128)
2014-11-18  Marc Glisse  <marc.glisse@inria.fr>

	PR libstdc++/43622
gcc/cp/
	* rtti.c (emit_support_tinfos): Handle __float128.
libstdc++-v3/
	* config/abi/pre/float128.ver: New file.
	* configure.ac: Use float128.ver when relevant.
	* configure: Regenerate.
	* testsuite/util/testsuite_abi.cc (check_version): Accept new
	CXXABI_FLOAT128 version.

From-SVN: r217735
2014-11-18 20:20:53 +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
Joel Sherrill 2c59c2d1a2 mt_allocator.cc: Fix assumption that sizeof(void *) is equal to sizeof(size_t).
2014-11-14  Joel Sherrill <joel.sherrill@oarcorp.com>

	* src/c++98/mt_allocator.cc: Fix assumption that sizeof(void *) is
	equal to sizeof(size_t). The m32c breaks this assumption.

From-SVN: r217576
2014-11-14 16:57:20 +00: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