Jonathan Wakely
bdfc9f5c54
PR59170 make pretty printers check for singular iterators
...
PR libstdc++/59170
* python/libstdcxx/v6/printers.py (StdListIteratorPrinter.to_string)
(StdSlistIteratorPrinter.to_string, StdVectorIteratorPrinter.to_string)
(StdRbtreeIteratorPrinter.to_string)
(StdDequeIteratorPrinter.to_string): Add check for value-initialized
iterators.
* testsuite/libstdc++-prettyprinters/simple.cc: Test them.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
From-SVN: r243692
2016-12-15 14:13:36 +00:00
Jonathan Wakely
50a8a9413d
PR59161 make pretty printers always return strings
...
PR libstdc++/59161
* python/libstdcxx/v6/printers.py (StdListIteratorPrinter.to_string)
(StdSlistIteratorPrinter.to_string, StdVectorIteratorPrinter.to_string)
(StdRbtreeIteratorPrinter.to_string, StdDequeIteratorPrinter.to_string)
(StdDebugIteratorPrinter.to_string): Return string instead of
gdb.Value.
* testsuite/libstdc++-prettyprinters/59161.cc: New test.
From-SVN: r243690
2016-12-15 13:25:22 +00:00
Jonathan Wakely
7224c6a997
Tweak formatting and docs for pretty printers
...
* python/libstdcxx/v6/printers.py (UniquePointerPrinter.to_string):
Remove redundant parentheses.
(RbtreeIterator, StdRbtreeIteratorPrinter): Add docstrings.
(StdForwardListPrinter.to_string): Remove redundant parentheses.
(StdExpOptionalPrinter.to_string): Use string formatting instead of
concatenation.
(StdVariantPrinter.to_string, StdNodeHandlePrinter.to_string)
(TemplateTypePrinter): Adjust whitespace.
From-SVN: r243689
2016-12-15 12:45:47 +00:00
Jonathan Wakely
0376e86bfc
Add GDB XMethods for shared_ptr and unique_ptr<T[]>
...
* python/libstdcxx/v6/xmethods.py (UniquePtrGetWorker.__init__): Use
correct element type for unique_ptr<T[]>.
(UniquePtrGetWorker._supports, UniquePtrDerefWorker._supports): New
functions to disable unsupported operators for unique_ptr<T[]>.
(UniquePtrSubscriptWorker): New worker for operator[].
(UniquePtrMethodsMatcher.__init__): Register UniquePtrSubscriptWorker.
(UniquePtrMethodsMatcher.match): Call _supports on the chosen worker.
(SharedPtrGetWorker, SharedPtrDerefWorker, SharedPtrSubscriptWorker)
(SharedPtrUseCountWorker, SharedPtrUniqueWorker): New workers.
(SharedPtrMethodsMatcher): New matcher for shared_ptr.
(register_libstdcxx_xmethods): Register SharedPtrMethodsMatcher.
* testsuite/libstdc++-xmethods/unique_ptr.cc: Test arrays.
* testsuite/libstdc++-xmethods/shared_ptr.cc: New test.
From-SVN: r243688
2016-12-15 12:45:42 +00:00
François Dumont
b958889311
stl_tree.h (_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore before C++11 mode.
...
2016-12-14 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_tree.h
(_Rb_tree_impl(const _Key_compare&, const _Node_allocator&): Restore
before C++11 mode.
From-SVN: r243670
2016-12-14 20:50:07 +00:00
Jonathan Wakely
d33c00e1ce
Make printers use singular noun for a single element
...
* python/libstdcxx/v6/printers.py (num_elements): New function.
(StdMapPrinter.to_string, StdSetPrinter.to_string)
(StdDequePrinter.to_string, Tr1UnorderedSetPrinter.to_string)
(Tr1UnorderedMapPrinter.to_string): Use num_elements.
* testsuite/libstdc++-prettyprinters/cxx11.cc: Adjust expected results
to use singular noun when there is only one element.
* testsuite/libstdc++-prettyprinters/debug.cc: Likewise.
* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple.cc: Likewise.
* testsuite/libstdc++-prettyprinters/simple11.cc: Likewise.
* testsuite/libstdc++-prettyprinters/tr1.cc: Likewise.
From-SVN: r243652
2016-12-14 16:07:29 +00:00
Jonathan Wakely
3c760f4a79
Make printers detect invalid debug mode iterators
...
PR libstdc++/59170
* python/libstdcxx/v6/printers.py (StdDebugIteratorPrinter): Use
_M_sequence and _M_version to detect invalid iterators.
* testsuite/libstdc++-prettyprinters/debug.cc: Test debug mode vector
and test invalid iterators.
* testsuite/libstdc++-prettyprinters/debug_cxx11.cc: New test.
From-SVN: r243650
2016-12-14 15:17:57 +00:00
Kyrylo Tkachov
39c429372b
[libstdc++][testsuite] XFAIL tests relying on long double-to-string conversions on broken newlib
...
* lib/target-supports.exp
(check_effective_target_newlib_broken_long_double_io): New check.
(check_effective_target_frexpl): Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/char/stod.cc:
XFAIL run if newlib_broken_long_double_io.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc:
Likewise.
* testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stold.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_arithmetic/char/hexfloat.cc:
Likewise.
From-SVN: r243558
2016-12-12 15:47:47 +00:00
Jonathan Wakely
1c43384234
Remove stray character at end of dg-do directive
...
* testsuite/experimental/filesystem/operations/is_empty.cc:
Remove stray character at end of dg-do directive.
From-SVN: r243555
2016-12-12 14:32:23 +00:00
Jonathan Wakely
8152d6eff6
Remove stray character at end of dg-do directive
...
* testsuite/experimental/filesystem/operations/temp_directory_path.cc:
Remove stray character at end of dg-do directive.
From-SVN: r243548
2016-12-12 12:44:46 +00:00
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