Commit Graph

9572 Commits

Author SHA1 Message Date
Jonathan Wakely 9b796223a3 Fix std::variant for gnu-versioned--namespace build
* include/std/variant: Remove misplaced
	_GLIBCXX_BEGIN_NAMESPACE_VERSION macro.

From-SVN: r243489
2016-12-09 15:22:01 +00:00
David Edelsohn 410aa8982f parallel_algorithm_assert2.cc: Move dg-do run first.
* testsuite/25_algorithms/headers/algorithm/
        parallel_algorithm_assert2.cc: Move dg-do run first.

From-SVN: r243468
2016-12-08 17:35:24 -05:00
Eric Botcazou 0a7577bbac re PR libstdc++/78264 (ICE in build_noexcept_spec, at cp/except.c:1196)
PR libstdc++/78264
	* include/bits/c++config (_GLIBCXX_NOEXCEPT_PARM): Turn _N into _NE.
	(_GLIBCXX_NOEXCEPT_QUAL): Likewise.

From-SVN: r243443
2016-12-08 15:52:11 +00:00
Jonathan Wakely fdb0b271e8 Fix filesystem test that fails in debug mode
* testsuite/experimental/filesystem/path/construct/range.cc: Don't
	use basic_string::front() when string might be empty.

From-SVN: r243438
2016-12-08 13:25:09 +00:00
Jonathan Wakely 1d752b4fee Delete std::swap for debug mode array
* include/debug/array (swap): Add deleted overload.
	* include/bits/stl_pair.h (swap): Remove redundant inline keyword
	from deleted overload.
	* include/bits/unique_ptr.h (swap): Likewise.
	* include/std/array (swap): Likewise.
	* include/std/optional (swap): Likewise.
	* include/std/tuple (swap): Likewise.
	* include/std/variant (swap): Likewise.
	* testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/23_containers/array/tuple_interface/get_neg.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/
	tuple_element_debug_neg.cc: Likewise.
	* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
	Likewise.

From-SVN: r243437
2016-12-08 13:25:03 +00:00
Jonathan Wakely eae0b895e0 PR71856 try to fix Parallel Mode assertions again
PR libstdc++/71856
	* doc/xml/manual/using.xml: Document macro.
	* include/bits/c++config [_GLIBCXX_DEBUG || _GLIBCXX_PARALLEL]
	(__glibcxx_assert): Rename to __glibcxx_assert_impl.
	[_GLIBCXX_DEBUG] (__glibcxx_assert): Expand to __glibcxx_assert_impl.
	* include/parallel/base.h [_GLIBCXX_PARALLEL_ASSERTIONS]
	(_GLIBCXX_PARALLEL_ASSERT): Expand to __glibcxx_assert_impl.
	[!_GLIBCXX_PARALLEL_ASSERTIONS] (_GLIBCXX_PARALLEL_ASSERT): Define as
	empty.
	* testsuite/25_algorithms/headers/algorithm/
	parallel_algorithm_assert2.cc: New test.

From-SVN: r243434
2016-12-08 12:08:14 +00:00
Jakub Jelinek 1d09844a1c P0003R5 - removal of dynamic exception specification from C++17
P0003R5 - removal of dynamic exception specification from C++17
	* parser.c (cp_parser_exception_specification_opt): For C++17
	error out on throw ( type-id-list ), for C++11 and C++14 issue
	-Wdeprecated warning on it.  Formatting fix.  Treat throw()
	in C++17 as noexcept(true).

	* g++.dg/compat/eh/ctor1.h: Adjust for deprecation of
	throw (type-id-list) in C++11 and C++14 and removal in C++17.
	* g++.dg/compat/eh/ctor1_y.C: Likewise.
	* g++.dg/compat/eh/new1_x.C: Likewise.
	* g++.dg/compat/eh/new1_y.C: Likewise.
	* g++.dg/compat/eh/spec3_x.C: Likewise.
	* g++.dg/compat/eh/spec3_y.C: Likewise.
	* g++.dg/compat/eh/template1.h: Likewise.
	* g++.dg/compat/eh/template1_y.C: Likewise.
	* g++.dg/compat/eh/unexpected1_x.C: Likewise.
	* g++.dg/compat/eh/unexpected1_y.C: Likewise.
	* g++.dg/cpp0x/auto9.C: Likewise.
	* g++.dg/cpp0x/defaulted23.C: Likewise.
	* g++.dg/cpp0x/error5.C: Likewise.
	* g++.dg/cpp0x/lambda/lambda-eh2.C: Likewise.
	* g++.dg/cpp0x/noexcept02.C: Likewise.
	* g++.dg/cpp0x/noexcept07.C: Likewise.
	* g++.dg/cpp0x/noexcept08.C: Likewise.
	* g++.dg/cpp0x/noexcept19.C: Likewise.
	* g++.dg/cpp0x/variadic73.C: Likewise.
	* g++.dg/cpp0x/variadic-throw.C: Likewise.
	* g++.dg/cpp1z/noexcept-type1.C: Likewise.
	* g++.dg/eh/async-unwind2.C: Likewise.
	* g++.dg/eh/cond4.C: Likewise.
	* g++.dg/eh/delete1.C: Likewise.
	* g++.dg/eh/ehopt1.C: Likewise.
	* g++.dg/eh/forced3.C: Likewise.
	* g++.dg/eh/forced4.C: Likewise.
	* g++.dg/eh/init-temp2.C: Likewise.
	* g++.dg/eh/pr38662.C: Likewise.
	* g++.dg/eh/pr41819.C: Likewise.
	* g++.dg/eh/shadow1.C: Likewise.
	* g++.dg/eh/spec2.C: Likewise.
	* g++.dg/eh/spec3.C: Likewise.
	* g++.dg/eh/spec5.C: Likewise.
	* g++.dg/eh/spec6.C: Likewise.
	* g++.dg/eh/spec7.C: Likewise.
	* g++.dg/eh/spec8.C: Likewise.
	* g++.dg/eh/spec9.C: Likewise.
	* g++.dg/eh/template1.C: Likewise.
	* g++.dg/eh/unexpected1.C: Likewise.
	* g++.dg/ext/has_nothrow_assign.C: Likewise.
	* g++.dg/ext/has_nothrow_constructor.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-1.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-2.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-4.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-5.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-6.C: Likewise.
	* g++.dg/ext/has_nothrow_copy-7.C: Likewise.
	* g++.dg/gcov/gcov-7.C: Likewise.
	* g++.dg/init/new13.C: Likewise.
	* g++.dg/init/new25.C: Likewise.
	* g++.dg/lookup/exception1.C: Likewise.
	* g++.dg/opt/noreturn-1.C: Likewise.
	* g++.dg/other/error3.C: Likewise.
	* g++.dg/rtti/crash3.C: Likewise.
	* g++.dg/template/eh2.C: Likewise.
	* g++.dg/template/error36.C: Likewise.
	* g++.dg/tm/pr46567.C: Likewise.
	* g++.dg/tm/pr47340.C: Likewise.
	* g++.dg/torture/pr46364.C: Likewise.
	* g++.dg/torture/pr49394.C: Likewise.
	* g++.dg/torture/pr52918-1.C: Likewise.
	* g++.dg/torture/pr57190.C: Likewise.
	* g++.dg/torture/stackalign/eh-alloca-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-global-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-inline-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-inline-2.C: Likewise.
	* g++.dg/torture/stackalign/eh-thiscall-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-vararg-1.C: Likewise.
	* g++.dg/torture/stackalign/eh-vararg-2.C: Likewise.
	* g++.dg/tree-ssa/pr45605.C: Likewise.
	* g++.dg/warn/Wreturn-type-3.C: Likewise.
	* g++.old-deja/g++.eh/badalloc1.C: Likewise.
	* g++.old-deja/g++.eh/cleanup2.C: Likewise.
	* g++.old-deja/g++.eh/spec1.C: Likewise.
	* g++.old-deja/g++.eh/spec2.C: Likewise.
	* g++.old-deja/g++.eh/spec3.C: Likewise.
	* g++.old-deja/g++.eh/spec4.C: Likewise.
	* g++.old-deja/g++.eh/spec6.C: Likewise.
	* g++.old-deja/g++.eh/throw1.C: Likewise.
	* g++.old-deja/g++.eh/throw2.C: Likewise.
	* g++.old-deja/g++.eh/tmpl1.C: Likewise.
	* g++.old-deja/g++.eh/tmpl3.C: Likewise.
	* g++.old-deja/g++.mike/eh15.C: Likewise.
	* g++.old-deja/g++.mike/eh25.C: Likewise.
	* g++.old-deja/g++.mike/eh33.C: Likewise.
	* g++.old-deja/g++.mike/eh34.C: Likewise.
	* g++.old-deja/g++.mike/eh50.C: Likewise.
	* g++.old-deja/g++.mike/eh51.C: Likewise.
	* g++.old-deja/g++.mike/eh55.C: Likewise.
	* g++.old-deja/g++.mike/p10416.C: Likewise.
	* g++.old-deja/g++.other/crash28.C: Likewise.
	* g++.old-deja/g++.other/crash30.C: Likewise.
	* g++.old-deja/g++.other/new7.C: Likewise.
	* g++.old-deja/g++.pt/ehspec1.C: Likewise.
	* g++.old-deja/g++.robertl/eb123.C: Likewise.

	* testsuite/util/testsuite_new_operators.h: Include testsuite_hooks.h.
	(operator new): Use THROW macro.

From-SVN: r243429
2016-12-08 09:26:06 +01:00
François Dumont 352f824f09 2016-12-07 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_tree.h
	(_Rb_tree<>::_M_copy(_Const_Link_type, _Base_ptr)): Delete.
	(_Rb_tree<>::_M_copy(const _Rb_tree&, _NodeGen&)): New.
	(_Rb_tree<>::_M_copy(const _Rb_tree&)): New, use latter.
	(_Rb_tree<>(const _Rb_tree&): Use latter.
	(_Rb_tree<>(const _Rb_tree&, const allocator_type&)): Likewise.
	(_Rb_tree<>::_M_move_data(_Rb_tree&, false_type)): Likewise.
	(_Rb_tree<>::_M_move_assign(_Rb_tree&, false_type)): Likewise.
	(_Rb_tree<>::operator=(const _Rb_tree&)): Likewise.

From-SVN: r243380
2016-12-07 21:16:24 +00:00
François Dumont a4dec0d6de stl_map.h (map(const map&)): Make default.
2016-12-07  François Dumont  <fdumont@gcc.gnu.org>

	* include/bits/stl_map.h (map(const map&)): Make default.
	(map(map&&)): Likewise.
	(~map()): Likewise.
	(operator=(const map&)): Likewise.
	* include/bits/stl_multimap.h (multimap(const multimap&)): Make default.
	(multimap(multimap&&)): Likewise.
	(~multimap()): Likewise.
	(operator=(const multimap&)): Likewise.
	* include/bits/stl_set.h (set(const set&)): Make default.
	(set(set&&)): Likewise.
	(~set()): Likewise.
	(operator=(const set&)): Likewise.
	* include/bits/stl_multiset.h (multiset(const multiset&)): Make default.
	(multiset(multiset&&)): Likewise.
	(~multiset()): Likewise.
	(operator=(const multiset&)): Likewise.
	* include/bits/stl_tree.h (_Rb_tree_key_compare<>): New.
	(_Rb_tree_header): New.
	(_Rb_tree_impl): Inherit from latters.
	(_Rb_tree_impl()): Make default.
	(_Rb_tree_impl(const _Rb_tree_impl&)): New.
	(_Rb_tree<>(const _Rb_tree&): Use latter.
	(_Rb_tree_impl(_Rb_tree_impl&&)): New, default.
	(_Rb_tree_impl(const _Key_compare&, const _Node_allocator&)): Delete.
	(_Rb_tree_impl::_M_reset): Move...
	(_Rb_tree_header::_M_reset): ...here.
	(_Rb_tree_impl::_M_initialize): Delete.
	(_Rb_tree(_Rb_tree&&)): Make default.
	(_Rb_tree_header::_M_move_data(_Rb_tree_header&)): New.
	(_Rb_tree<>::_M_move_data(_Rb_tree&, true_type)): Use latter.
	(_Rb_tree<>(_Rb_tree&&)): Make default.

From-SVN: r243379
2016-12-07 21:12:49 +00:00
Jonathan Wakely 435f434288 Replace uses of C++14 remove_cv_t alias in C++11 header
* include/experimental/bits/fs_path.h (path::_S_convert): Replace
	uses of C++14 std::remove_cv_t alias template.

From-SVN: r243355
2016-12-07 15:23:01 +00:00
Jonathan Wakely d71f5aa799 Replace use of C++14 std::exchange in C++11 testcase
* testsuite/28_regex/traits/char/user_defined.cc: Replace uses of
	C++14 std::exchange function.

From-SVN: r243354
2016-12-07 15:22:57 +00:00
Jonathan Wakely 1f153a1d2a Replace dynamic exception specifications in testsuite
* testsuite/util/testsuite_hooks.h (THROW): Define.
	* testsuite/util/replacement_memory_operators.h: Include
	testsuite_hooks.h and use THROW macro.
	* testsuite/util/testsuite_tr1.h: Likewise.
	* testsuite/20_util/allocator/1.cc: Use THROW macro.
	* testsuite/22_locale/locale/cons/12352.cc: Likewise.
	* testsuite/23_containers/vector/zero_sized_allocations.cc: Likewise.
	* testsuite/30_threads/lock_guard/cons/1.cc: Replace dynamic exception
	specification with noexcept-specifier.
	* testsuite/ext/pool_allocator/allocate_chunk.cc: Include
	testsuite_hooks.h and use THROW macro.
	* testsuite/ext/profile/replace_new.cc: Likewise.

From-SVN: r243353
2016-12-07 15:22:51 +00:00
Jonathan Wakely ba454dfbbe Use _GLIBCXX_THROW macro in bitmap_allocator
* include/ext/bitmap_allocator.h (bitmap_allocator::_S_refill_pool)
	(bitmap_allocator::_M_allocate_single_object)
	(bitmap_allocator::_M_get): Use _GLIBCXX_THROW macro.

From-SVN: r243352
2016-12-07 15:22:44 +00:00
Jonathan Wakely 101ee3cc73 Disable test using std::set_unexcepted for C++17
* testsuite/18_support/bad_exception/59392.cc: Disable for C++17.

From-SVN: r243351
2016-12-07 15:22:37 +00:00
Jonathan Wakely 63915a91ab Improve tests for contents of <new> header
* testsuite/18_support/headers/new/synopsis.cc: Add C++14 and C++17
	declarations.
	* testsuite/18_support/headers/new/synopsis_cxx98.cc: New test.

From-SVN: r243349
2016-12-07 15:22:24 +00:00
Felipe Magno de Almeida f68963c092 Add #ifdef case for 16 bits in cow-stdexcept.cc
Added #ifdef case for when void* is 16 bits so it compiles in AVR
target.

2016-12-06  Felipe Magno de Almeida  <felipe@expertisesolutions.com.br>

	* src/c++11/cow-stdexcept.cc: Add special case for 16 bit pointers.

From-SVN: r243310
2016-12-06 17:58:10 +00:00
Felipe Magno de Almeida 6649ad7efd Enable libstdc++ compilation on AVR targets
Enable libstdc++ compilation in AVR targets with AVR-Libc. Most
floating point math functions are already defined in AVR-Libc, so
defines are in place to avoid multiple definition of these functions.

2016-12-06  Felipe Magno de Almeida  <felipe@expertisesolutions.com.br>

	* crossconfig.m4: Add avr target for cross-compilation.
	* configure: Regenerate.

From-SVN: r243309
2016-12-06 17:58:05 +00:00
Jonathan Wakely 449a432129 Fix pretty-printer for std::variant
* python/libstdcxx/v6/printers.py (StdVariantPrinter): Update for new
	data member name.
	* testsuite/libstdc++-prettyprinters/cxx17.cc: Remove redundant test.

From-SVN: r243304
2016-12-06 14:36:07 +00:00
Jonathan Wakely 55037a694f Fix debug mode assertion for std::shared_ptr<void>
* include/bits/shared_ptr_base.h
	(__shared_ptr_access<T, L, false, true>::operator->()): Fix assertion.

From-SVN: r243303
2016-12-06 14:36:00 +00:00
Jonathan Wakely 505326670f Fix libstdc++-v3/ChangeLog dates
From-SVN: r243299
2016-12-06 12:48:54 +00:00
Ville Voutilainen 1637d42545 Constrain optional's __constexpr_addressof in its return type and use a constexpr addressof for optional, if available.
Constrain optional's __constexpr_addressof in its return type
and use a constexpr addressof for optional, if available.
* include/experimental/optional (__constexpr_addressof):
Constrain in the return type instead of in a template parameter.
(_Has_addressof_mem)
(_Has_addressof_free, _Has_addressof, __constexpr_addressof):
Guard with #ifndef __cpp_lib_addressof_constexpr.
(operator->()): Use std::__addressof if it's constexpr.

From-SVN: r243298
2016-12-06 14:47:54 +02:00
Tim Shen b01af236b7 variant (visit): Make visit constexpr.
* include/std/variant (visit): Make visit constexpr. Also cleanup
	__get_alternative and __storage, since we don't support reference/void
	alternatives any more.
	* testsuite/20_util/variant/compile.cc: Add tests.

From-SVN: r243295
2016-12-06 11:28:09 +00:00
Tim Shen 458ef69052 enable_special_members.h: Make _Enable_default_constructor constexpr.
* include/bits/enable_special_members.h: Make
	_Enable_default_constructor constexpr.
	* include/std/variant (variant::emplace, variant::swap, std::swap,
	std::hash): Sfinae on emplace and std::swap; handle __poison_hash bases
	of duplicated types.
	* testsuite/20_util/variant/compile.cc: Add tests.
	* testsuite/20_util/variant/hash.cc: Add tests.

From-SVN: r243294
2016-12-06 11:26:48 +00:00
Tim Shen 9189f55908 variant (std::get, operator==): Implement constexpr comparison and get<>.
* include/std/variant (std::get, operator==): Implement constexpr
	comparison and get<>.
	* testsuite/20_util/variant/compile.cc: Tests.

From-SVN: r243293
2016-12-06 11:20:13 +00:00
Tim Shen 44f4688595 variant (__erased_use_alloc_ctor, [...]): Remove uses-allocator related functions.
* include/std/variant (__erased_use_alloc_ctor,
	_Variant_base::_Variant_base, variant::variant): Remove uses-allocator
	related functions.
	* testsuite/20_util/variant/compile.cc: Remove related tests.
	* testsuite/20_util/variant/run.cc: Remove related tests.

From-SVN: r243292
2016-12-06 11:17:56 +00:00
Aditya Kumar b6f684ae25 Add missing noexcept on std::_Sp_locker constructors
2016-12-06  Aditya Kumar  <hiraditya@msn.com>

	* src/c++11/shared_ptr.cc (_Sp_locker::_Sp_locker(const void* p)): Add
	noexcept on constructor.
	(_Sp_locker::_Sp_locker(const void* p1, const void* p2)): Same.

From-SVN: r243291
2016-12-06 10:43:49 +00:00
Jonathan Wakely 39a0325104 Add noexcept to various basic_string string operations
* include/bits/basic_string.h (basic_string::find, basic_string::rfind)
	(basic_string::find_first_of, basic_string::find_last_of)
	(basic_string::find_first_not_of, basic_string::find_last_not_of):
	Make all overloads noexcept.
	(basic_string::compare(const _CharT*)): Make noexcept.

From-SVN: r243290
2016-12-06 10:43:42 +00:00
John David Anglin f9b6b9291d baseline_symbols.txt: Regenerate.
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Regenerate.

From-SVN: r243220
2016-12-03 16:10:43 +00:00
David Edelsohn 0269650d4a * testsuite/26_numerics/headers/cmath/hypot.cc: XFAIL on AIX.
From-SVN: r243127
2016-12-01 14:02:34 -05:00
Ville Voutilainen a2863bde75 Implement LWG 2766,
Swapping non-swappable types and LWG 2749,
swappable traits for variants.
* include/bits/move.h (swap(_Tp&, _Tp&)): Constrain
with __is_tuple_like.
* include/bits/stl_pair.h (swap(pair<_T1, _T2>&, pair<_T1, _T2>&)):
Add a deleted overload.
* include/bits/unique_ptr.h
(swap(unique_ptr<_Tp, _Dp>&, unique_ptr<_Tp, _Dp>&)): Likewise.
* include/std/array
(swap(array<_Tp, _Nm>&, array<_Tp, _Nm>&)): Likewise.
* include/std/optional
(swap(optional<_Tp>&, optional<_Tp>&)): Likewise.
* include/std/tuple (__is_tuple_like_impl, __is_tuple_like):
Move to type_traits.
(swap(tuple<_Elements...>&, tuple<_Elements...>&)): Add a deleted
overload.
* include/std/type_traits (__is_tuple_like_impl, __is_tuple_like):
New.
(swap(_Tp&, _Tp&)): Constrain with __is_tuple_like.
* include/std/utility (__is_tuple_like_impl): Move to type_traits.
* include/std/variant
(swap(variant<_Types...>&, variant<_Types...>&)):
Add a deleted overload.
* testsuite/20_util/optional/swap/2.cc: Add tests for disabled
swaps.
* testsuite/20_util/pair/swap_cxx17.cc: New.
* testsuite/20_util/tuple/swap_cxx17.cc: Likewise.
* testsuite/20_util/unique_ptr/specialized_algorithms/swap_cxx17.cc:
Likewise.
* testsuite/20_util/variant/compile.cc: Add tests for disabled
swaps.
* testsuite/23_containers/array/specialized_algorithms/swap_cxx17.cc:
New.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Likewise.

From-SVN: r243120
2016-12-01 18:23:21 +02:00
Ville Voutilainen d9b2d86c74 The convertible_to traits need to use a variadic catch-all for the false-cases.
The convertible_to traits need to use a variadic catch-all for the
false-cases.
* include/std/istream (__is_convertible_to_basic_istream):
Change the parameter of the false-case of __check to a variadic.
* include/std/ostream (__is_convertible_to_basic_ostream):
Likewise.

From-SVN: r243098
2016-12-01 09:14:19 +02:00
Bernd Edlinger 77e6870d7f crossconfig.m4 (*-linux*): Add link-check for memalign.
2016-12-01  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        * crossconfig.m4 (*-linux*): Add link-check for memalign.
        * configure: Regenerated.

From-SVN: r243095
2016-12-01 06:06:04 +00:00
Tim Shen 974afa584b re PR libstdc++/71500 (regex::icase only works on first character in a range)
PR libstdc++/71500
	* include/bits/regex.h (basic_regex::basic_regex): Use ECMAScript
	when the syntax is not specified.
	* include/bits/regex_compiler.h (_RegexTranslator,
	_RegexTranslatorBase): Partially support icase in ranges.
	* include/bits/regex_compiler.tcc (_BracketMatcher::_M_apply):
	Refactor _M_apply to make the control flow easier to follow, and
	call _M_translator._M_match_range as added previously.
	* testsuite/28_regex/traits/char/icase.cc: Add new tests.
	* testsuite/28_regex/traits/char/user_defined.cc: Add new tests.

From-SVN: r243093
2016-12-01 03:03:55 +00:00
Ville Voutilainen 3ba9051e44 Fix testsuite failures caused by the patch implementing LWG 2534.
* include/std/istream (__is_convertible_to_basic_istream):
Change the return types of __check, introduce istream_type.
(operator>>(_Istream&&, _Tp&&)):
Use __is_convertible_to_basic_istream::istream_type as the return type.
* include/std/ostream (__is_convertible_to_basic_ostream):
Change the return types of __check, introduce ostream_type.
(operator>>(_Ostream&&, _Tp&&)):
Use __is_convertible_to_basic_ostream::ostream_type as the return type.

From-SVN: r243036
2016-11-30 18:32:24 +02:00
Tim Shen 88811a9753 Fix condition in shared_ptr assertion
2016-11-30  Tim Shen  <timshen@google.com>

	* include/bits/shared_ptr_base.h
	(__shared_ptr_access<T, L, true, false>::operator*()): Fix assertion.

From-SVN: r243027
2016-11-30 14:46:15 +00:00
David Edelsohn 6d0e8a552f 50594.cc: XFAIL on AIX.
* testsuite/18_support/50594.cc: XFAIL on AIX.
        * testsuite/ext/mt_allocator/check_new.cc: Same.
        * testsuite/ext/pool_allocator/check_new.cc: Same.
        * testsuite/27_io/ios_base/storage/11584.cc: Same.

From-SVN: r243023
2016-11-30 09:33:02 -05:00
Ville Voutilainen a7da488130 Implement LWG 2534, Constrain rvalue stream operators.
* include/std/istream (__is_convertible_to_basic_istream): New.
(__is_extractable): Likewise.
(operator>>(basic_istream<_CharT, _Traits>&&, _Tp&&)):
Turn the stream parameter into a template parameter
and constrain.
* include/std/ostream (__is_convertible_to_basic_ostream): New.
(__is_insertable): Likewise.
(operator<<(basic_ostream<_CharT, _Traits>&&, const _Tp&)):
Turn the stream parameter into a template parameter
and constrain.
* testsuite/27_io/basic_istream/extractors_other/char/4.cc: New.
* testsuite/27_io/basic_istream/extractors_other/wchar_t/4.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_other/char/6.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_other/wchar_t/6.cc: Likewise.

From-SVN: r243006
2016-11-30 11:59:50 +02:00
Christophe Lyon dfad822a61 [libstdc++, testsuite] Add dg-require-thread-fence
2016-11-30  Christophe Lyon  <christophe.lyon@linaro.org>

	* testsuite/experimental/type_erased_allocator/2.cc: Add
	dg-require-thread-fence.

From-SVN: r243001
2016-11-30 09:49:01 +01:00
David Edelsohn 57e27acf28 re PR libstdc++/68838 (AIX 32 bit wchar_t testsuite failures)
PR libstdc++/68838
* testsuite/lib/libstdc++.exp (DEFAULT_CXXFLAGS): Add -Wl,-bmaxdata on AIX.
* testsuite/23_containers/vector/profile/vector.cc: Remove
dg-additional-options.

From-SVN: r242967
2016-11-29 12:50:27 -05:00
Tim Shen 3203ed5f01 re PR libstdc++/78441 ([variant] variant_alternative doesn't allow cv qualifiers)
PR libstdc++/78441
	* include/std/variant: Propagate cv qualifications to types returned
	by variant_alternative.
	* testsuite/20_util/variant/compile.cc: Tests.

From-SVN: r242892
2016-11-27 00:32:04 +00:00
Jonathan Wakely 756316926e Fix PR number in ChangeLog
From-SVN: r242765
2016-11-23 15:32:37 +00:00
Felix Morgner f6cdfe8264 PR78494 add missing returns to propagate_const
2016-11-23  Felix Morgner  <felix.morgner@gmail.com>
	    Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/78494
	* include/experimental/propagate_const (propagate_const::operator=):
	Add missing return statements.
	* testsuite/experimental/propagate_const/assignment/move_neg.cc:
	Adjust dg-error line numbers.
	* testsuite/experimental/propagate_const/requirements2.cc: Likewise.

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

From-SVN: r242760
2016-11-23 14:45:29 +00:00
Uros Bizjak b2b0acbe2b Makefile.in ($(lang_checks_parallelized)): Fix detection of -j argument.
gcc/ChangeLog

	* Makefile.in ($(lang_checks_parallelized)): Fix detection
	of -j argument.

gcc/ada/ChangeLog

	* gcc-interface/Make-lang.in (check-acats): Fix detection
	of -j argument.

libstdc++-v3/ChangeLog

	* testsuite/Makefile.am
	(check-DEJAGNU $(check_DEJAGNU_normal_targets)): Fix detection
	of -j argument.
	* testsuite/Makefile.in: Regenereate.

From-SVN: r242705
2016-11-22 17:33:43 +01:00
Jonathan Wakely dba814afda PR78465 Remove runtime tests for <atomic> macros
PR libstdc++/78465
	* testsuite/29_atomics/headers/atomic/macros.cc: Replace runtime tests
	with preprocessor conditions.

From-SVN: r242704
2016-11-22 16:31:19 +00:00
Rainer Orth 3115f94f7f Don't define libstdc++-internal macros in Solaris 10+ <math.h>
libstdc++-v3:
	* acinclude.m4 (GLIBCXX_CHECK_MATH11_PROTO): Update comments.
	(__CORRECT_ISO_CPP11_MATH_H_PROTO): Rename to ...
	(__CORRECT_ISO_CPP11_MATH_H_PROTO_FP): ... this.
	Add test for C++11 <math.h> integral overloads.
	* configure: Regenerate.
	* config.h.in: Regenerate.

	* include/c_global/cmath [__cplusplus >= 201103L]: Reflect
	__CORRECT_ISO_CPP11_MATH_H_PROTO to
	__CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.
	* include/c_global/cmath [_GLIBCXX_USE_C99_MATH &&
	!_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC && __cplusplus >= 201103L]
	(std::fpclassify): Wrap in !__CORRECT_ISO_CPP11_MATH_H_PROTO_INT.
	(std::isfinite): Likewise.
	(std::isinf): Likewise.
	(std::isnan): Likewise.
	(std::isnormal): Likewise.
	(std::signbit): Likewise.
	(std::isgreater): Likewise.
	(std::isgreaterequal): Likewise.
	(std::isless): Likewise.
	(std::islessequal): Likewise.
	(std::islessgreater): Likewise.
	(std::isunordered): Likewise.
	[__cplusplus >= 201103L && _GLIBCXX_USE_C99_MATH_TR1]
	(std::acosh): Likewise.
	(std::asinh): Likewise.
	(std::atanh): Likewise.
	(std::cbrt): Likewise.
	(std::copysign): Likewise.
	(std::erf): Likewise.
	(std::erfc): Likewise.
	(std::exp2): Likewise.
	(std::expm1): Likewise.
	(std::fdim): Likewise.
	(std::fma): Likewise.
	(std::fmax): Likewise.
	(std::fmin): Likewise.
	(std::hypot): Likewise.
	(std::ilogb): Likewise.
	(std::lgamma): Likewise.
	(std::llrint): Likewise.
	(std::llround): Likewise.
	(std::log1p): Likewise.
	(std::log2): Likewise.
	(std::logb): Likewise.
	(std::lrint): Likewise.
	(std::lround): Likewise.
	(std::nearbyint): Likewise.
	(std::nextafter): Likewise.
	(std::nexttoward): Likewise.
	(std::remainder): Likewise.
	(std::remquo): Likewise.
	(std::rint): Likewise.
	(std::round): Likewise.
	(std::scalbln): Likewise.
	(std::scalbn): Likewise.
	(std::tgamma): Likewise.
	(std::trunc): Likewise.
	* include/tr1/cmath [_GLIBCXX_USE_C99_MATH_TR1 && __cplusplus >=
	201103L]: Reflect __CORRECT_ISO_CPP11_MATH_H_PROTO to
	__CORRECT_ISO_CPP11_MATH_H_PROTO_FP rename.

	fixincludes:
	* inclhack.def (solaris_math_12): New fix.
	(hpux11_fabsf): Replace bypass by *-hp-hpux11* mach selector.
	* fixincl.x: Regenerate.
	* tests/base/math.h [SOLARIS_MATH_12_CHECK]: New test.

From-SVN: r242671
2016-11-21 16:09:47 +00:00
Jonathan Wakely 27b3b3f4e6 PR 59406 note that FNV hash functions are incorrect
PR libstdc++/59406
	* include/bits/functional_hash.h: Add comment noting difference from
	FNV-1a.
	* include/tr1/functional_hash.h: Likewise.
	* libsupc++/hash_bytes.cc: Likewise.

From-SVN: r242454
2016-11-15 20:17:39 +00:00
Jonathan Wakely 3663671a13 Use existing helper for new std::string constructor
* include/bits/basic_string.h: Reuse _If_sv alias template for new
	constructor.

From-SVN: r242453
2016-11-15 19:32:52 +00:00
Jonathan Wakely 6ae2ae3b84 Make std::tuple_size<cv T> SFINAE-friendly (LWG 2770)
* doc/xml/manual/intro.xml: Document LWG 2770 status. Remove entries
	for 2742 and 2748.
	* doc/html/*: Regenerate.
	* include/std/utility (__tuple_size_cv_impl): New helper to safely
	detect tuple_size<T>::value, as per LWG 2770.
	(tuple_size<cv T>): Adjust partial specializations to derive from
	__tuple_size_cv_impl.
	* testsuite/20_util/tuple/cv_tuple_size.cc: Test SFINAE-friendliness.

From-SVN: r242452
2016-11-15 19:32:44 +00:00
Jonathan Wakely 6f959acccb Adjust pretty printer test for variant<T&>
* testsuite/libstdc++-prettyprinters/cxx17.cc: Adjust test for
	variant<T&>.

From-SVN: r242449
2016-11-15 19:29:07 +00:00
Tim Shen 7b277e8b46 variant: Remove variant<T&>...
* include/std/variant: Remove variant<T&>, variant<void>, variant<> support
	to rebase on the post-Issaquah design.
	* testsuite/20_util/variant/compile.cc: Likewise.

From-SVN: r242437
2016-11-15 17:26:59 +00:00