Commit Graph

8682 Commits

Author SHA1 Message Date
Jonathan Wakely 744e26e71e re PR libstdc++/65630 (operator+ for new std::string not exported)
PR libstdc++/65630
	* config/abi/pre/gnu.ver: Export operator+ for new strings.
	* testsuite/21_strings/basic_string/operators/char/65630.cc: New.
	* testsuite/21_strings/basic_string/operators/wchar_t/65630.cc: New.

From-SVN: r221775
2015-03-30 18:52:37 +01:00
Tim Shen 2894311302 re PR libstdc++/65420 (Enumerators in std::regex_constants should be constexpr variables instead)
PR libstdc++/65420
	* include/bits/regex_constants.h: Use constexpr variables for flags.
	* testsuite/28_regex/constants/constexpr.cc: New testcase.

From-SVN: r221750
2015-03-28 04:17:12 +00:00
Jonathan Wakely 04f69fda7a re PR libstdc++/65499 (Missing "using namespace literals::chrono_literals" in std::chrono)
PR libstdc++/65499
	* include/std/chrono: Add using-directive for literals to std::chrono.
	* testsuite/20_util/duration/literals/65499.cc: New.

From-SVN: r221730
2015-03-27 12:45:10 +00:00
Jonathan Wakely d1a74a287e re PR libstdc++/58038 (std::this_thread::sleep_until can cause inifinite sleep)
PR libstdc++/58038
	PR libstdc++/60421
	* include/std/thread (this_thread::sleep_for): Check for negative
	durations.
	(this_thread::sleep_until): Check for times in the past.
	* testsuite/30_threads/this_thread/58038.cc: New.
	* testsuite/30_threads/this_thread/60421.cc: New.

From-SVN: r221708
2015-03-26 19:59:08 +00:00
Jonathan Wakely 4280698d09 re PR libstdc++/62259 (atomic class doesn't enforce required alignment on powerpc64)
PR libstdc++/62259
	PR libstdc++/65147
	* include/std/atomic (atomic<T>): Increase alignment for types with
	the same size as one of the integral types.
	* testsuite/29_atomics/atomic/60695.cc: Adjust dg-error line number.
	* testsuite/29_atomics/atomic/62259.cc: New.

From-SVN: r221703
2015-03-26 19:27:02 +00:00
Richard Henderson 8be568519b re PR libstdc++/65033 (C++11 atomics: is_lock_free result does not always match the real lock-free property)
PR libstdc++/65033

 * include/bits/atomic_base.h (__atomic_base<T>::is_lock_free): Build
 a fake pointer indicating type alignment.
 (__atomic_base<T *>::is_lock_free): Likewise.
 * include/std/atomic (atomic<T>::is_lock_free): Likewise.

From-SVN: r221701
2015-03-26 11:31:11 -07:00
Alan Lawrence 28fda0c459 re PR libstdc++/33394 (Add test case for Thread race segfault in std::string::append with -O and -s)
PR libstdc++/33394
	* testsuite/21_strings/basic_string/pthread33394.cc: Use
	dg-additional-options.

From-SVN: r221666
2015-03-25 15:46:58 +00:00
Paolo Carlini ea348bbe59 re PR libstdc++/65543 (rvalue stream insertion and extraction operators incorrectly implemented)
2015-03-25  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/65543
	* include/std/istream (operator>>(basic_istream<>&&, _Tp&): Revert
	thinko in r150387.
	* include/std/ostream (operator<<(basic_ostream<>&&, const _Tp&):
	Likewise.
	* testsuite/27_io/rvalue_streams-2.cc: New.

From-SVN: r221655
2015-03-25 09:57:06 +00:00
Jonathan Wakely 9ccd0dba21 re PR libstdc++/33394 (Add test case for Thread race segfault in std::string::append with -O and -s)
PR libstdc++/33394
	* testsuite/21_strings/basic_string/pthread33394.cc: Add test.

# Auto-generated commit message above this line, original below.
	PR libstdc++/33394
	* testsuite/21_strings/basic_string/pthread33394.cc: Add test.

From-SVN: r221635
2015-03-24 14:47:32 +00:00
Jonathan Wakely 8dcf3d3c5d re PR libstdc++/64967 (Bootstrap fails due to errors in libstdc++ sources with `--enable-symvers=gnu-versioned-namespace')
PR libstdc++/64967
	* acinclude.m4: Disable dual ABI when gnu-versioned-namespace in use.
	* configure: Regenerate.
	* src/c++11/compatibility-c++0x.cc (error_category), generic_category,
	system_category): Use macros for versioned namespace.
	* src/c++11/futex.cc: Add missing end macro for versioned namespace.

From-SVN: r221600
2015-03-23 16:47:18 +00:00
James Greenhalgh c00acee464 [Patch Testsuite] Make all_attributes.cc in to (almost_)all_attributes.cc for ARM.
* testsuite/17_intro/headers/c++1998/all_attributes.cc: Disable
	test for unused for ARM.
	* testsuite/17_intro/headers/c++200x/all_attributes.cc: Likewise.
	* testsuite/17_intro/headers/c++2014/all_attributes.cc: Likewise.

From-SVN: r221538
2015-03-20 17:20:12 +00:00
Jonathan Wakely df6d9c7f6a c++config (__gnu_cxx::__cxx11): Define new namespace.
* include/bits/c++config (__gnu_cxx::__cxx11): Define new namespace.
	* include/ext/codecvt_specializations.h (encoding_state,
	encoding_char_traits): Remove abi-tag and use inline namespace.
	* testsuite/ext/profile/mutex_extensions_neg.cc: Adjust dg-error line.

From-SVN: r221533
2015-03-20 13:26:55 +00:00
Jason Merrill 7cb7357360 re PR c++/65046 (-Wabi-tag doesn't warn about variables or function return types)
PR c++/65046
	Automatically propagate ABI tags to variables and functions
	from their (return) type.
	* class.c (check_tag): Handle variables and functions.
	(mark_or_check_attr_tags): Split out from find_abi_tags_r.
	(mark_or_check_tags): Likewise.
	(mark_abi_tags): Use it.  Rename from mark_type_abi_tags.
	(check_abi_tags): Add single argument overload for decls.
	Handle inheriting tags for decls.
	* mangle.c (write_mangled_name): Call it.
	(mangle_return_type_p): Split out from write_encoding.
	(unmangled_name_p): Split out from write_mangled_name.
	(write_mangled_name): Ignore abi_tag on namespace.
	* cp-tree.h (NAMESPACE_IS_INLINE): Replace NAMESPACE_ABI_TAG.
	* parser.c (cp_parser_namespace_definition): Set it.
	* name-lookup.c (handle_namespace_attrs): Use arguments. Warn
	about abi_tag attribute on non-inline namespace.
	* tree.c (check_abi_tag_args): Split out from handle_abi_tag_attribute.
	(handle_abi_tag_attribute): Allow tags on variables.

From-SVN: r221521
2015-03-19 15:31:48 -04:00
Jonathan Wakely 168ad5f5e3 re PR c++/65046 (-Wabi-tag doesn't warn about variables or function return types)
PR c++/65046
	* config/locale/gnu/messages_members.cc (Catalog_info, Catalogs,
	get_catalogs): Add abi-tag.
	* include/ext/codecvt_specializations.h (encoding_state,
	encoding_char_traits): Likewise.
	* src/c++11/cxx11-ios_failure.cc (io_error_category): Likewise.
	* src/c++11/cxx11-shim_facets.cc (__any_string::operator basic_string,
	numpunct_shim, collate_shim, time_get_shim, moneypunct_shim,
	money_get_shim, money_put_shim, messages_shim): Likewise.
	* src/c++11/future.cc (future_error_category::message): Likewise.
	* src/c++11/system_error.cc (generic_error_category::message,
	system_error_category::message): Likewise.
	(__sso_string): Disable -Wabi-tag warnings.

From-SVN: r221497
2015-03-18 18:08:29 +00:00
Jonathan Wakely 2a9611d03b re PR libstdc++/13631 (Problems in messages)
PR libstdc++/13631
	* config/locale/gnu/messages_members.cc (get_glibc_msg): Fix fallback
	implementation for old glibc. Fix whitespace.

From-SVN: r221494
2015-03-18 16:17:47 +00:00
Jonathan Wakely 5e0216f173 acinclude.m4 (GLIBCXX_CHECK_GTHREADS): Check for pthread_rwlock_t.
2015-03-18  Jonathan Wakely  <jwakely@redhat.com>
	    Torvald Riegel  <triegel@redhat.com>

	* acinclude.m4 (GLIBCXX_CHECK_GTHREADS): Check for pthread_rwlock_t.
	* config.h.in: Regenerate.
	* configure: Regenerate.
	* include/std/shared_mutex: Check _GLIBCXX_USE_PTHREAD_RWLOCK_T.
	(shared_timed_mutex::_M_rwlock): Use PTHREAD_RWLOCK_INITIALIZER.
	(shared_timed_mutex::lock_shared()): Retry on EAGAIN.
	(shared_timed_mutex::try_lock_shared_until()): Retry on EAGAIN and
	EDEADLK.

Co-Authored-By: Torvald Riegel <triegel@redhat.com>

From-SVN: r221484
2015-03-18 10:53:38 +00:00
Jonathan Wakely 1c6f4a147d 1.cc: Remove name of unused exception variable.
* testsuite/30_threads/shared_lock/modifiers/1.cc: Remove name of
	unused exception variable.
	* testsuite/30_threads/unique_lock/modifiers/1.cc: Likewise.
	* testsuite/30_threads/shared_lock/modifiers/2.cc: Remove duplicate
	test.
	* testsuite/30_threads/unique_lock/modifiers/2.cc: Likewise.

From-SVN: r221477
2015-03-17 16:36:32 +00:00
Jonathan Wakely 95f2fd9c5d nested_exception.h: Do not try to derive from final classes.
* libsupc++/nested_exception.h: Do not try to derive from final
	classes.
	* testsuite/18_support/nested_exception/throw_with_nested.cc: Test
	final class.

From-SVN: r221476
2015-03-17 14:24:55 +00:00
Jonathan Wakely e83a01c383 * include/experimental/system_error: Fix include guard.
From-SVN: r221417
2015-03-13 12:47:21 +00:00
Jonathan Wakely 9b78b1e730 acinclude.m4: Make --enable-libstdcxx-time=auto work for dragonfly.
* acinclude.m4: Make --enable-libstdcxx-time=auto work for dragonfly.
	* configure: Regenerate.

From-SVN: r221414
2015-03-13 10:49:08 +00:00
Renlin Li 04a1709359 [PATCH]Remove xfail for wrapped target
libstdc++-v3/

2015-03-12  Renlin Li  <renlin.li@arm.com>

	* testsuite/27_io/ios_base/sync_with_stdio/1.cc: Remove xfail for
	wrapped target.

From-SVN: r221393
2015-03-12 15:00:28 +00:00
Tim Shen 84839a5140 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.h (match_results<>::size,
	match_results<>::position, match_results<>::str,
	match_results<>::operator[], match_results<>::prefix,
	match_results<>::suffix, match_results<>::end,
	match_results<>::_M_resize, match_results<>::_M_unmatched_sub,
	match_results<>::_M_prefix, match_results<>::_M_suffix): Remove
	global __unmatched_sub. Add unmatched submatch as part of
	match_results.
	* include/bits/regex.tcc (__regex_algo_impl<>, regex_replace<>,
	regex_iterator<>::operator++): Adjust to use match_results::_M_prefix.
	* testsuite/28_regex/match_results/out_of_range_submatches.cc:
	New testcases.

From-SVN: r221330
2015-03-10 18:41:46 +00:00
Jonathan Wakely d2e0c00b8c re PR libstdc++/64467 (28_regex/traits/char/isctype.cc and wchar_t/isctype.cc)
PR libstdc++/64467
	* testsuite/28_regex/traits/char/isctype.cc: Don't test newline
	for newlib targets. Really fix mixed line-endings this time.

From-SVN: r221279
2015-03-09 12:47:51 +00:00
Jonathan Wakely 664e99eac4 future (future_error(error_code)): Construct base class with error_code's message.
* include/std/future (future_error(error_code)): Construct base
	class with error_code's message.
	* src/c++11/future.cc (future_error::what()): Do not call c_str() on
	temporary string.

From-SVN: r221236
2015-03-06 12:31:43 +00:00
Jonathan Wakely 9933260f2f locale_conv.h (wstring_convert::_M_conv): Handle noconv result.
* include/bits/locale_conv.h (wstring_convert::_M_conv): Handle
	noconv result.
	* testsuite/22_locale/conversions/string/2.cc: Also test UTF-8.
	* testsuite/22_locale/conversions/string/3.cc: Likewise, and UTF-16.

From-SVN: r221212
2015-03-05 13:36:21 +00:00
Jonathan Wakely b6584a72ac re PR libstdc++/64797 (22_locale/conversions/string/2.cc FAILs)
PR libstdc++/64797
	* include/bits/locale_conv.h (wstring_convert::_M_conv): Handle
	incomplete multibyte sequences correctly.
	* include/std/codecvt (codecvt_utf8, codecvt_utf16,
	codecvt_utf8_utf16): Limit _Maxcode to maximum Unicode code point.
	* src/c++11/codecvt.cc (invalid_mb_sequence, incomplete_mb_character):
	Define constants.
	(is_high_surrogate, is_low_surrogate, surrogate_pair_to_code_point):
	Define convenience functions.
	(read_utf8_code_point): Return relevant constant to distinguish
	incomplete characters from invalid sequences.
	(read_utf16_code_point): Likewise. Check for invalid sequences.
	(ucs4_in, utf16_in): Use incomplete_mb_character constant.
	(utf16_out): Check for invalid sequences.
	(utf16_span): Fix condition.
	(ucs2_out): Use is_high_surrogate.
	(ucs2_in): Use incomplete_mb_character constant and fix condition.
	* testsuite/22_locale/codecvt/char16_t.cc: Fix whitespace.
	* testsuite/22_locale/conversions/buffer/1.cc: New.
	* testsuite/22_locale/conversions/string/2.cc: Use char16_t and
	char32_t instead of wchar_t.
	* testsuite/22_locale/conversions/string/3.cc: New.

From-SVN: r221189
2015-03-04 17:19:55 +00:00
Iain Sandoe 71ca36ba7b re PR libstdc++/64883 (FAIL: 17_intro/headers/c++*/all_attributes.cc (test for excess errors) on x86_64-apple-darwin10)
2015-03-03  Iain Sandoe  <iain@codesourcery.com>

	PR libstdc++/64883
	* testsuite/17_intro/headers/c++1998/all_attributes.cc: Don't check
	visibility for Darwin.
	* testsuite/17_intro/headers/c++200x/all_attributes.cc: Likewise, and
	also deprecated.
	* testsuite/17_intro/headers/c++2014/all_attributes.cc: Likewise.

From-SVN: r221160
2015-03-03 18:14:20 +00:00
Jonathan Wakely 9d8dbe732a re PR libstdc++/65279 (std::scoped_allocator_adaptor is not assignable)
PR libstdc++/65279
	* include/std/scoped_allocator (__inner_type_impl,
	scoped_allocator_adaptor): Add defaulted copy assignment and move
	assignment operators.
	* testsuite/20_util/scoped_allocator/65279.cc: New.

From-SVN: r221119
2015-03-02 17:50:55 +00:00
Jonathan Wakely e59a2e945e 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 (__sso_string): Don't use non-static member
	in sizeof.

From-SVN: r221118
2015-03-02 16:50:24 +00:00
Matthias Klose f083b434c2 re PR libstdc++/65246 (libstdc++ pretty printers don't work anymore with Python3)
2015-02-28  Matthias Klose  <doko@ubuntu.com>

        PR libstdc++/65246
        * python/libstdcxx/v6/__init__.py: Use explicit relative imports.

From-SVN: r221076
2015-02-28 09:22:43 +00:00
Jonathan Wakely 1d5f1ff217 status_cxx2011.xml: Remove duplicated information.
* doc/xml/manual/status_cxx2011.xml: Remove duplicated information.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r220894
2015-02-22 13:20:32 +00:00
Jonathan Wakely b56ac9d5f4 status_cxx2011.xml: Document implementation-defined behavior.
* doc/xml/manual/status_cxx2011.xml: Document implementation-defined
	behavior.
	* doc/html/manual/status.html: Regenerate.

From-SVN: r220878
2015-02-20 19:01:46 +00:00
Jonathan Wakely deaa1ccbec re PR libstdc++/64695 (FAIL: libstdc++-prettyprinters/cxx11.cc)
PR libstdc++/64695
	* python/libstdcxx/v6/printers.py (StdTuplePrinter): Handle new
	tuple layout.

From-SVN: r220871
2015-02-20 14:40:00 +00:00
Jonathan Wakely 87839f22d2 re PR libstdc++/58357 (In C++11 std::rotate(first, middle, last) now should return a forward iterator to first + (last - middle).)
PR libstdc++/58357
	* include/bits/algorithmfwd.h (rotate): Move to inline namespace _V2.
	* include/bits/stl_algo.h (__rotate, rotate): Likewise.

From-SVN: r220823
2015-02-19 20:57:40 +00:00
Hans-Peter Nilsson 53b2288f93 re PR testsuite/65093 (26_numerics/random/binomial_distribution/operators/values.cc times out on slow targets)
PR testsuite/65093
	* testsuite/26_numerics/random/binomial_distribution/operators/values.cc
	(test01): Add explanatory comment.  Keep only the bd1 sub-test and
	split out bd2, bd3, bd4, and bd5 sub-tests into...
	* testsuite/26_numerics/random/binomial_distribution/operators/values2.cc,
	testsuite/26_numerics/random/binomial_distribution/operators/values3.cc,
	testsuite/26_numerics/random/binomial_distribution/operators/values4.cc,
	testsuite/26_numerics/random/binomial_distribution/operators/values5.cc:
	New separate files with the old parts.

From-SVN: r220821
2015-02-19 19:30:03 +00:00
Jonathan Wakely 01bf6bdb10 char16_t.cc: Add dg-require-cstdint.
* testsuite/22_locale/codecvt/char16_t.cc: Add dg-require-cstdint.
	* testsuite/22_locale/codecvt/char32_t.cc: Likewise.

From-SVN: r220795
2015-02-18 20:21:04 +00:00
Jonathan Wakely 7f971f18e4 codecvt.cc (write_utf16_code_point): Fix code to output surrogate pairs.
* src/c++11/codecvt.cc (write_utf16_code_point): Fix code to output
	surrogate pairs.
	(utf16_in): Pass mode argument to write_utf16_code_point.
	(codecvt<char16_t, char, mbstate_t>::do_in): Set mode according to
	native byte order.
	* testsuite/22_locale/codecvt/char16_t.cc: New.
	* testsuite/22_locale/codecvt/in/wchar_t/1.cc: Fix typo.

From-SVN: r220793
2015-02-18 19:39:03 +00:00
Rüdiger Sonderfeld fb96818737 char32_t.cc: New.
2015-02-17  Rüdiger Sonderfeld  <ruediger@c-plusplus.de>
	    Jonathan Wakely  <jwakely@redhat.com>

	* testsuite/22_locale/codecvt/char32_t.cc: New.

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

From-SVN: r220760
2015-02-17 14:25:48 +00:00
Jonathan Wakely faa7d78e41 re PR libstdc++/65085 (Move-assigned empty string corrupt with -D_GLIBCXX_USE_CXX11_ABI=1)
PR libstdc++/65085
	* include/bits/basic_string.h (basic_string(basic_string&&)): Ensure
	empty string gets null-terminated.
	* testsuite/21_strings/basic_string/cons/char/65085.cc: New.

From-SVN: r220758
2015-02-17 12:44:26 +00:00
Matthew Wahab 1e0c223f94 isctype.cc (test01): Fix mixed line-endings introduced in last change.
* testsuite/28_regex/traits/char/isctype.cc (test01): Fix
	mixed line-endings introduced in last change.

From-SVN: r220682
2015-02-13 13:42:06 +00:00
Jason Merrill 864f0146f0 * testsuite/28_regex/traits/wchar_t/isctype.cc: Fix whitespace.
From-SVN: r220655
2015-02-12 15:20:30 -05:00
Matthew Wahab 72900b8306 isctype.cc (test01): Replace test for __NEWLIB__ macro with a dejagnu set macro.
* testsuite/28_regex/traits/char/isctype.cc (test01): Replace test
	for __NEWLIB__ macro with a dejagnu set macro.
	* testsuite/28_regex/traits/wchar_t/isctype.cc (test01): Likewise.

From-SVN: r220648
2015-02-12 14:55:23 +00:00
Matthew Wahab ff9eac2965 [PATCH][libstdc++][Testsuite] isctype test fails for newlib.
libstdc++-v3/
2015-02-02  Matthew Wahab  <matthew.wahab@arm.com>

	PR libstdc++/64467
	* testsuite/28_regex/testsuiteraits/char/isctype.cc (test01): Add newlib
	special case for '\n'.
	* test01estsuite/28_regex/traits/wchar_t/isctype.cc (test01): Likewise.

From-SVN: r220392
2015-02-04 09:24:56 +00:00
Jonathan Wakely 516db2dd07 * src/c++11/futex.cc: Do not define for gthr-single.h targets.
From-SVN: r220319
2015-02-01 15:11:23 +00:00
Jonathan Wakely 13fc08e44e re PR libstdc++/64883 (FAIL: 17_intro/headers/c++*/all_attributes.cc (test for excess errors) on x86_64-apple-darwin10)
PR libstdc++/64883
	* include/c_global/cstdio (gets): Use __deprecated__ attribute instead
	of deprecated.
	* include/c_std/cstdio (gets): Likewise.
	* testsuite/17_intro/headers/c++1998/all_attributes.cc: Avoid clashing
	with attributes used in darwin headers.

From-SVN: r220318
2015-02-01 15:11:08 +00:00
Jakub Jelinek 536616b775 acinclude.m4 (VTV_CYGMIN): Use x$vtv_cygmin = xyes instead of $vtv_cygmin = yes.
* acinclude.m4 (VTV_CYGMIN): Use x$vtv_cygmin = xyes instead of
	$vtv_cygmin = yes.  Initialize vtv_cygmin=no unconditionally first.
	* configure: Regenerated.

From-SVN: r220259
2015-01-29 19:36:03 +01:00
H.J. Lu f4392940cd Define VTV_CYGMIN after vtv_cygmin is set
* acinclude.m4 (GLIBCXX_ENABLE_VTABLE_VERIFY): Define VTV_CYGMIN
	after vtv_cygmin is set.
	* configure: Regenerated.

From-SVN: r220258
2015-01-29 10:21:33 -08:00
Matthias Klose 23842e9135 acinclude.m4 (GLIBCXX_ENABLE_VTABLE_VERIFY): Define VTV_CYGMIN unconditionally.
2015-01-29  Matthias Klose  <doko@ubuntu.com>

        * acinclude.m4 (GLIBCXX_ENABLE_VTABLE_VERIFY): Define VTV_CYGMIN
        unconditionally.
        * configure: Regenerate.

From-SVN: r220257
2015-01-29 18:12:29 +00:00
Caroline Tice 8be349eea9 Committing generated configure & Makefile.in pieces of VTV Cygwin patch (from Patrick Wollgast).
Committing generated configure & Makefile.in pieces of
VTV Cygwin patch (from Patrick Wollgast).  Forgot to 
commit these with the rest of the patch.

From-SVN: r220254
2015-01-29 08:47:25 -08:00
Jonathan Wakely 85d44192f6 atomic_base.h: Use __always_inline__ instead of always_inline.
* include/bits/atomic_base.h: Use __always_inline__ instead of
	always_inline.
	* include/bits/atomic_futex.h: Likewise.
	* include/bits/c++config: Use __abi_tag__ instead of abi_tag.
	* include/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp: Use
	__packed__ instead of packed.
	* include/std/shared_mutex: Use __unused__ instead of unused.
	* testsuite/17_intro/headers/c++1998/all_attributes.cc: New.
	* testsuite/17_intro/headers/c++200x/all_attributes.cc: New.
	* testsuite/17_intro/headers/c++2014/all_attributes.cc: New.

From-SVN: r220243
2015-01-29 12:47:20 +00:00