aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite
AgeCommit message (Collapse)AuthorFilesLines
2015-07-01alloc_traits.h (__alloctr_rebind): Remove.Jonathan Wakely2-1/+5
* include/bits/alloc_traits.h (__alloctr_rebind): Remove. (__allocator_traits_base): New base class. (__alloc_rebind): Reimplement in terms of detection idiom. (allocator_traits): Derive from __allocator_traits_base. Reimplement nested types in terms of detection idiom. Simplify SFINAE constraints on overloaded static member functions. * include/bits/hashtable.h (_Hashtable): Use __alloc_rebind instead of __alloctr_rebind. * testsuite/20_util/scoped_allocator/propagation.cc: Define rebind. * testsuite/23_containers/unordered_set/instantiation_neg.cc: Adjust dg-error line number. From-SVN: r225244
2015-07-01ptr_traits.h (__ptrtr_elt_type, [...]): RemoveJonathan Wakely2-2/+19
* include/bits/ptr_traits.h (__ptrtr_elt_type, __ptrtr_diff_type, __ptrtr_rebind, __ptrtr_not_void): Remove (__get_first_arg, __replace_first_arg, __make_not_void): Define new transformations. (__detected_or_): New detection trait. (pointer_traits): Use new traits. * testsuite/20_util/pointer_traits/pointer_to.cc: Add rebind member. * testsuite/20_util/pointer_traits/requirements/ explicit_instantiation.cc: Use valid arguments to pointer_traits. From-SVN: r225243
2015-07-01Implement N4502, the C++ Detection Idiom.Jonathan Wakely1-0/+85
* doc/xml/manual/status_cxx2017.xml: Update status table. * include/experimental/type_traits (void_t, is_detected, is_detected_v, detected_t, detected_or, detected_or_t, is_detected_exact, is_detected_exact_v, is_detected_convertible, is_detected_convertible_v): Define. * include/std/type_traits (__detector, __detected_or, __detected_or_t, __detected_or_t_): Define. * testsuite/experimental/type_traits/detection.cc: New. From-SVN: r225242
2015-06-30Implement N4387, "Improving pair and tuple", and LWG 2367.Ville Voutilainen5-3/+481
2015-06-30 Ville Voutilainen <ville.voutilainen@gmail.com> Implement N4387, "Improving pair and tuple", and LWG 2367. * include/bits/stl_pair.h (_ConstructiblePair, _ImplicitlyConvertiblePair, _MoveConstructiblePair, _ImplicitlyMoveConvertiblePair): New. (pair()): Constrain it. (pair(const _T1&, const _T2&), pair(const pair<_U1, _U2>&), pair(_U1&&, const _T2&), pair(const _T1&, _U2&&), pair(_U1&&, _U2&&), pair(pair<_U1, _U2>&&)): Make conditionally explicit. * include/std/tuple (_TC, tuple::_TC2, tuple::TCC, tuple::TMC): New. (tuple()): Constrain it. (tuple(const _UElements&...), tuple(_UElements&&...), tuple(const tuple<_UElements...>&), tuple(tuple<_UElements...>&&), tuple(allocator_arg_t, const _Alloc&, const _UElements&...), tuple(allocator_arg_t, const _Alloc&, _UElements&&...), tuple(allocator_arg_t, const _Alloc&, const tuple<_UElements...>&), tuple(allocator_arg_t, const _Alloc&, tuple<_UElements...>&&), tuple(const pair<_U1, _U2>&), tuple(pair<_U1, _U2>&&), tuple(allocator_arg_t, const _Alloc&, const pair<_U1, _U2>&), tuple(allocator_arg_t, const _Alloc&, pair<_U1, _U2>&&)): Make conditionally explicit. * include/experimental/functional (__boyer_moore_array_base): Name array type explicitly instead of using an empty braced-init-list. * testsuite/20_util/pair/cons/explicit_construct.cc: New. * testsuite/20_util/pair/piecewise.cc: Use piecewise_construct. * testsuite/20_util/pair/requirements/dr2367.cc: New. * testsuite/20_util/tuple/cons/explicit_construct.cc: New. * testsuite/20_util/tuple/requirements/dr2367.cc: New. From-SVN: r225189
2015-06-26Implement N4258 (Cleaning-up noexcept in the Library rev 3)Jonathan Wakely15-28/+83
* doc/xml/manual/intro.xml: Document LWG 2108 status. * include/bits/alloc_traits.h (allocator_traits::is_always_equal): Define. * include/bits/allocator.h (allocator::is_always_equal): Likewise. * include/bits/forward_list.h (forward_list::operator=(forward_list&&)): Use __bool_constant. (forward_list::swap(forward_list&)): Add noexcept. * include/bits/hashtable.h (_Hashtable::operator=(_Hashtable&&)): Likewise. (_Hashtable::swap(_Hashtable&)): Likewise. * include/bits/stl_deque.h (_Deque_base::_Deque_base(_Deque_base&&)): Use _Alloc_traits::is_always_equal. (deque::operator=(deque&&)): Likewise. (deque::_M_move_assign1(deque&&, false_type)): Add comment and use __bool_constant. (swap(deque&, deque&)): Add noexcept. * include/bits/stl_list.h (list::operator=(list&&)): Use __bool_constant. (swap(list&, list&)): Add noexcept. * include/bits/stl_map.h (map::swap(map&)): Include _Compare in noexcept. (swap(map&, map&)): Add noexcept. * include/bits/stl_multimap.h (multimap::swap(multimap&)): Include _Compare in noexcept. (swap(multimap&, multimap&)): Add noexcept. * include/bits/stl_multiset.h (multiset::swap(multiset&)): Include _Compare in noexcept. (swap(multiset&, multiset&)): Add noexcept. * include/bits/stl_set.h (set::swap(set&)): Include _Compare in noexcept. (swap(set&, set&)): Add noexcept. * include/bits/stl_tree.h (_Rb_tree::operator=(_Rb_tree&&)): Include _Compare in noexcept. (_Rb_tree::_Rb_tree(_Rb_tree&&, _Node_alloc_type&&)): Use is_always_equal. * include/bits/stl_vector.h (vector::operator=(vector&&)): Use __bool_constant. (swap(vector&, vector&)): Add noexcept. * include/bits/unordered_map.h (swap(unordered_map&, unordered_map&), swap(unordered_multimap& unordered_multimap&)): Add noexcept. * include/bits/unordered_set.h (swap(unordered_set&, unordered_set&), swap(unordered_multiset& unordered_multiset&)): Add noexcept. * include/ext/alloc_traits.h (__allocator_always_compares_equal): Remove. (__alloc_traits::_S_always_equal()): Use is_always_equal instead of __allocator_always_compares_equal. * include/ext/array_allocator.h (array_allocator::is_always_equal): Define. * include/std/scoped_allocator (__any_of, __propagate_on_copy, __propagate_on_move, __propagate_on_swap): Remove. (scoped_allocator_adaptor::propagate_on_container_copy_assignment, scoped_allocator_adaptor::propagate_on_container_move_assignment, scoped_allocator_adaptor::propagate_on_container_swap): Define with __and_ instead of __any_of. (scoped_allocator_adaptor::is_always_equal): Define. * testsuite/20_util/allocator_traits/members/is_always_equal.cc: New. * testsuite/20_util/scoped_allocator/propagation.cc: Make traits derive from true_type or false_type. * testsuite/23_containers/deque/allocator/move_assign-2.cc: Add is_always_equal member and remove the trait specialization. * testsuite/23_containers/vector/52591.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r225081
2015-06-24get_neg.cc: Adjust dg-error line numbers.Paolo Carlini2-4/+4
2015-06-24 Paolo Carlini <paolo.carlini@oracle.com> * testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc: Likewise. From-SVN: r224897
2015-06-23array: Include <array>.François Dumont2-4/+4
2015-06-23 François Dumont <fdumont@gcc.gnu.org> * include/debug/array: Include <array>. Add version namespace when specializing tuple interface to array. Add specialization for __is_tuple_like_impl. * include/profile/array: Likewise. * include/std/array: Include <utility>. Add specialization for __is_tuple_like_impl. * include/std/tuple (__is_tuple_like_impl<>, __is_tuple_like_impl<pair>): Move... * include/std/utility: ... here. Include <type_traits>. * testsuite/23_containers/array/tuple_interface/get_debug_neg.cc: Adjust dg-error line number. * testsuite/23_containers/array/tuple_interface/ tuple_element_debug_neg.cc: Likewise. From-SVN: r224857
2015-06-221.cc: Use non-negative rho argument.Jonathan Wakely1-1/+1
* testsuite/26_numerics/complex/value_operations/1.cc: Use non-negative rho argument. From-SVN: r224739
2015-06-17C++11 allocator support for std::list.Jonathan Wakely10-3/+450
PR libstdc++/55409 * include/bits/list.tcc (_List_base::_M_clear()): Use allocator traits. (list::list(const list&)): Use allocator propagation trait. Use _M_assign_dispatch to copy elements. * include/bits/stl_list.h (_List_node): Use __aligned_membuf in C++11. (_List_node::_M_valptr()): Add accessor for stored value. (_List_iterator, _List_const_iterator, _List_base): Use _M_valptr(). (_List_base, list): Use allocator traits. (_List_base::_M_get_Tp_allocator, _List_base::get_allocator): Remove. (_List_base::_M_move_nodes): New function. (_List_base(_List_base&&)): Use _M_move_nodes. (_List_base(_List_base&&, _Node_alloc_type&&)): New constructor. (list::_M_create_node, list::_M_erase, list::max_size): Use allocator traits. (list(size_type)): Add allocator parameter. (list(const list&)): Use allocator propagation trait. (list(const list&, const allocator_type&)): New constructor. (list(list&&, const allocator_type&)): Likewise. (list::operator=(list&&), list::swap(list&)): Use allocator propagation traits. (list::_M_move_assign): New functions. * include/debug/list: Add allocator-extended constructors. * include/profile/list: Likewise. * python/libstdcxx/v6/printers.py (get_value_from_list_node): New function to get value from _List_node. (StdListPrinter): Use get_value_from_list_node. * testsuite/23_containers/list/allocator/copy.cc: New. * testsuite/23_containers/list/allocator/copy_assign.cc: New. * testsuite/23_containers/list/allocator/minimal.cc: New. * testsuite/23_containers/list/allocator/move.cc: New. * testsuite/23_containers/list/allocator/move_assign.cc: New. * testsuite/23_containers/list/allocator/noexcept.cc: New. * testsuite/23_containers/list/allocator/swap.cc: New. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Adjust dg-prune-output line number. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. From-SVN: r224580
2015-06-17forward_list.h (forward_list::_M_get_Node_allocator): Remove unnecessary ↵Jonathan Wakely1-0/+32
uses of operator& and static_cast. * include/bits/forward_list.h (forward_list::_M_get_Node_allocator): Remove unnecessary uses of operator& and static_cast. * include/bits/forward_list.tcc (forward_list::operator=(const forward_list&)): Use __addressof instead of operator&. (forward_list::remove(const _Tp&), forward_list::remove(_Pred)): Remove invalid static_casts. * include/debug/forward_list: Use __addressof instead of operator&. * testsuite/23_containers/forward_list/modifiers/addressof.cc: New. From-SVN: r224553
2015-06-16list.tcc (list::operator=(const list&), [...]): Use __addressof instead of ↵Jonathan Wakely1-0/+32
operator&. * include/bits/list.tcc (list::operator=(const list&), list::merge): Use __addressof instead of operator&. (list::sort): Use array-to-pointer decay instead of operator&. * include/bits/stl_list.h (list::splice): Use __addressof instead of operator&. * include/debug/formatter.h (_Error_formatter::_Parameter::_Parameter): Likewise. * include/debug/functions.h (__check_singular): Likewise. * include/debug/list (list::splice, list::merge): Likewise. * testsuite/23_containers/list/modifiers/addressof.cc: New. From-SVN: r224539
2015-06-12Use atomics in guard.cc.Ramana Radhakrishnan3-4/+4
This provides proper definitions for _GLIBCXX_READ_MEM_BARRIER and _GLIBCXX_WRITE_MEM_BARRIER, rewrites the guards in terms of proper atomic extensions and removes internal uses of _GLIBCXX_READ_MEM_BARRIER and _GLIBCXX_WRITE_MEM_BARRIER and replaces them with equivalent atomics. 2015-06-12 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> PR target/66200 PR c++/66192 * * config/cpu/generic/atomic_word.h (_GLIBCXX_READ_MEM_BARRIER): Define (_GLIBCXX_WRITE_MEM_BARRIER): Likewise * include/bits/shared_ptr_base.h: Use ACQ_REL barrier. * include/ext/atomicity.h: Likewise. * include/tr1/shared_ptr.h: Likewise. * libsupc++/guard.cc (__test_and_acquire): Rewrite with atomics. Update comment. (__set_and_release): Likewise. * testsuite/20_util/shared_ptr/cons/43820_neg.cc (test01): Adjust for line numbers. * testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Likewise. From-SVN: r224411
2015-06-12tuple (__is_tuple_like_impl): Disambiguate array in debug and profile modes.Jonathan Wakely1-1/+5
* include/std/tuple (__is_tuple_like_impl): Disambiguate array in debug and profile modes. * testsuite/25_algorithms/headers/algorithm/synopsis.cc: Adjust tests for swap in C++11 and later. From-SVN: r224397
2015-06-08re PR libstdc++/66441 (wstring_convert not working correctly)Jonathan Wakely1-0/+49
PR libstdc++/66441 * testsuite/22_locale/conversions/string/66441.cc: New. * include/bits/locale_conv.h (__do_str_codecvt): Reserve enough space in the output string for BOM and complete result. From-SVN: r224222
2015-06-08re PR libstdc++/66417 (std::codecvt_utf16<char32_t, 0x10FFFF, ↵Jonathan Wakely1-0/+76
std::codecvt_mode::generate_header> generates incorrect output) PR libstdc++/66417 * src/c++11/codecvt.cc (write_utf16_code_point): Use adjust_byte_order for single UTF-16 units. * testsuite/22_locale/codecvt/codecvt_utf16/66417.cc: New. From-SVN: r224217
2015-06-07stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename ↵François Dumont4-67/+75
to ... 2015-06-07 François Dumont <fdumont@gcc.gnu.org> * include/bits/stl_tree.h (_Rb_tree<>::__is_transparent<>): Move to outer scope and rename to ... (std::__hash_is_transparent<>): ... this. * include/debug/stl_map.h (map::find<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): New member function templates to perform heterogeneous lookup. * include/debug/stl_multimap.h (multimap::find<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/debug/stl_multiset.h (multiset::find<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/debug/stl_set.h (set::find<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * include/profile/stl_map.h (map::find<>, map::count<>, map::lower_bound<>, map::upper_bound<>, map::equal_range<>): Likewise. * include/profile/stl_multimap.h (multimap::find<>, multimap::count<>, multimap::lower_bound<>, multimap::upper_bound<>, multimap::equal_range<>): Likewise. * include/profile/stl_multiset.h (multiset::find<>, multiset::count<>, multiset::lower_bound<>, multiset::upper_bound<>, multiset::equal_range<>): Likewise. * include/profile/stl_set.h (set::find<>, set::count<>, set::lower_bound<>, set::upper_bound<>, set::equal_range<>): Likewise. * testsuite/23_containers/map/operations/1.cc: Check const variants. * testsuite/23_containers/multimap/operations/1.cc: Likewise. * testsuite/23_containers/multiset/operations/1.cc: Likewise. * testsuite/23_containers/set/operations/1.cc: Likewise. From-SVN: r224200
2015-06-05status_cxx2017.xml: Update status tables.Jonathan Wakely4-4/+30
* doc/xml/manual/status_cxx2017.xml: Update status tables. * doc/html/manual/*: Regenerate. * include/std/type_traits (bool_constant): Define. * testsuite/20_util/bool_constant/requirements.cc: New. * testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise. From-SVN: r224160
2015-06-05shared_mutex (__shared_mutex_pthread, [...]): New helper types implementing ↵Jonathan Wakely6-0/+268
the shared mutex requirements. * include/std/shared_mutex (__shared_mutex_pthread, __shared_mutex_cv): New helper types implementing the shared mutex requirements. (shared_mutex): New type for C++17. (shared_timed_mutex): Derive from one of the new helper types. * testsuite/30_threads/shared_mutex/cons/1.cc: New. * testsuite/30_threads/shared_mutex/cons/assign_neg.cc: New. * testsuite/30_threads/shared_mutex/cons/copy_neg.cc: New. * testsuite/30_threads/shared_mutex/requirements/standard_layout.cc: New. * testsuite/30_threads/shared_mutex/try_lock/1.cc: New. * testsuite/30_threads/shared_mutex/try_lock/2.cc: New. From-SVN: r224158
2015-06-05Add __is_nothrow_swappable and take it into use.Ville Voutilainen3-0/+131
2015-06-04 Ville Voutilainen <ville.voutilainen@gmail.com> Add __is_nothrow_swappable and take it into use. * include/bits/algorithmfwd.h (swap): Only declare for C++98 mode. * include/bits/move.h (swap): Add constraints in C++11 and later. * include/bits/stl_pair.h (swap): Use __is_nothrow_swappable for the free swap function for pair. * include/bits/stl_queue.h (swap): Use __is_nothrow_swappable for the free swap functions for queue and priority_queue. * include/bits/stl_stack.h (swap): Use __is_nothrow_swappable for the free swap function for stack. * include/debug/array (swap): Use __is_nothrow_swappable for the free swap function for array. * include/profile/array (swap): Likewise. * include/std/array (swap): Likewise. * include/std/tuple (_Tuple_impl::_M_swap): Use __is_nothrow_swappable. * include/std/type_traits (__is_swappable_impl::__is_swappable, __is_nothrow_swappable_impl, __is_nothrow_swappable): New. * testsuite/20_util/is_nothrow_swappable/requirements/ explicit_instantiation.cc: New. * testsuite/20_util/is_nothrow_swappable/requirements/typedefs.cc: New. * testsuite/20_util/is_nothrow_swappable/value.cc: New. From-SVN: r224153
2015-06-032015-06-03 François Dumont fdumont@gcc.gnu.org>François Dumont1-0/+1
* testsuite/23_containers/list/61347.cc: Add dg-require-normal-mode. From-SVN: r224100
2015-06-02[libstdc++-v3]Add _GLIBCXX_HAVE_LIMIT_FSIZE to guard 27_io/fpos/14775.cc.Renlin Li1-1/+1
libstdc++-v3/ 2015-06-02 Renlin Li <renlin.li@arm.com> * testsuite/27_io/fpos/14775.cc: Add _GLIBCXX_HAVE_LIMIT_FSIZE check. From-SVN: r224015
2015-06-01libstdc++.exp (libstdc++_init): Unset LANGUAGE environment variable.Jonathan Wakely1-0/+4
* testsuite/lib/libstdc++.exp (libstdc++_init): Unset LANGUAGE environment variable. From-SVN: r223937
2015-05-292015-05-29 François Dumont fdumont@gcc.gnu.org>François Dumont2-4/+4
* include/debug/debug.h (_GLIBCXX_DEBUG_ASSERT, _GLIBCXX_DEBUG_PEDASSERT, _GLIBCXX_DEBUG_ONLY): Move definition... * include/debug/assertions.h: ...here, new. * include/debug/formatter.h (_Error_formatter::_Is_iterator_value_type): New. (_Error_formatter::_Is_instance): New. (_Error_formatter::_Parameter): Make public and not friend anymore. (_Error_formatter::_Parameter::__instance): New _M_kind enum entry. (_Error_formatter::_Parameter::__iterator_value_type): New _M_kind enum entry. (_Error_formatter::_Parameter::_Type): New. (_Error_formatter::_Parameter::_Instance): New, inherit from latter. (union _Error_formatter::_Parameter::_M_variant): Reorganize. (_Parameter(_Iterator const&, const char*, _Is_iterator)): Make all overloads take iterator through a const reference. (_Parameter(const _Iterator&, const char*, _Is_iterator_value_type)): New. (_Parameter(const _Type&, const char*, _Is_instance)): New. (_Error_formatter::_M_print_type): Delete. (_Error_formatter::_M_iterator_value_type): New. (_Error_formatter::_M_instance): New. * include/Makefile.am: Add new above debug file. * include/Makefile.in: Regenerate. * include/debug/functions.h (__check_dereferenceable(const _Safe_iterator<>&), __valid_range(const _Safe_iterator<>&), __is_safe_random_iterator<_Safe_iterator<>>): Move... * include/debug/safe_iterator.h: ... here. Replace debug.h include with assertions.h. (__check_singular_aux): Move... * include/debug/safe_base.h: ... here. * include/debug/functions.h (__check_dereferenceable(const _Safe_local_iterator<>&), __valid_range(const _Safe_local_iterator<>&): Move... * include/debug/safe_local_iterator.h: ...here. * include/debug/safe_sequence.h: Replace debug.h with assertions.h. Remove _Safe_iterator declaration. * include/debug/safe_unordered_container.h: Replace debug.h with assertions.h. * include/debug/array: Replace safe_sequence.h include with formatter.h and macros.h. * include/debug/deque: Include functions.tcc. * include/debug/forward_list: Likewise. * include/debug/list: Likewise. * include/debug/string: Likewise. * include/debug/vector: Likewise. * include/bits/unique_ptr.h: Replace debug.h include with new assertions.h. * include/bits/stl_iterator_base_funcs.h: Likewise. * testsuite/23_containers/array/tuple_interface/get_debug_neg.cc: Adjust dg-error line number. * testsuite/23_containers/array/tuple_interface/ tuple_element_debug_neg.cc: Likewise. * src/c++11/debug.cc: Adapt. From-SVN: r223877
2015-05-29future (__async_result_of): New alias template.Jonathan Wakely1-0/+42
* include/std/future (__async_result_of): New alias template. (async): Use __async_result_of to pass decayed types to result_of. * testsuite/30_threads/async/lwg2021.cc: New. * doc/xml/manual/intro.xml: Document LWG 2021 status. From-SVN: r223866
2015-05-28re PR libstdc++/65352 (array<T,0>::begin()/end() etc. forms a null reference ↵Jonathan Wakely2-3/+3
and breaks on clang+ubsan) PR libstdc++/65352 * include/std/array (__array_traits::_S_ptr): New function. (array::data): Use _S_ptr to avoid creating invalid reference. * testsuite/23_containers/array/tuple_interface/get_neg.cc: Adjust dg-error line numbers. * testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc: likewise. From-SVN: r223806
2015-05-26xmethods.py (UniquePtrMethodsMatcher): Add operator-> support.Doug Evans1-1/+18
* python/libstdcxx/v6/xmethods.py (UniquePtrMethodsMatcher): Add operator-> support. * testsuite/libstdc++-xmethods/unique_ptr.cc: Add tests for operator->. From-SVN: r223723
2015-05-26locale_conv.h: Fix copyright years.Jonathan Wakely8-8/+8
* include/bits/locale_conv.h: Fix copyright years. * include/bits/quoted_string.h: Likewise. * src/filesystem/Makefile.am: Likewise. * testsuite/22_locale/conversions/buffer/1.cc: Likewise. * testsuite/22_locale/conversions/buffer/requirements/typedefs.cc: Likewise. * testsuite/22_locale/conversions/string/1.cc: Likewise. * testsuite/22_locale/conversions/string/2.cc: Likewise. * testsuite/22_locale/conversions/string/3.cc: Likewise. * testsuite/22_locale/conversions/string/requirements/typedefs-2.cc: Likewise. * testsuite/22_locale/conversions/string/requirements/typedefs.cc: Likewise. * testsuite/util/testsuite_fs.h: Likewise. From-SVN: r223676
2015-05-20* testsuite/util/testsuite_fs.h (nonexistent_path): Don't use tempnam.Jonathan Wakely1-10/+5
From-SVN: r223450
2015-05-20re PR libstdc++/66078 ↵Jonathan Wakely3-3/+146
(20_util/specialized_algorithms/uninitialized_copy/808590.cc fails with -std=c++11) PR libstdc++/66078 * include/bits/stl_iterator.h (__make_move_if_noexcept_iterator): Add overload for pointers. * testsuite/20_util/specialized_algorithms/uninitialized_copy/ 808590.cc: Add -std=gnu++03 switch. * testsuite/20_util/specialized_algorithms/uninitialized_copy/ 808590-cxx11.cc: Copy of 808590.cc to test with -std=gnu++11. * testsuite/23_containers/vector/modifiers/push_back/ strong_guarantee.cc: New. From-SVN: r223449
2015-05-1966055.cc: Add constructor invocations.François Dumont4-0/+16
2015-05-19 François Dumont <fdumont@gcc.gnu.org> * testsuite/23_containers/unordered_map/cons/66055.cc: Add constructor invocations. * testsuite/23_containers/unordered_multimap/cons/66055.cc: Likewise. * testsuite/23_containers/unordered_multiset/cons/66055.cc: Likewise. * testsuite/23_containers/unordered_set/cons/66055.cc: Likewise. From-SVN: r223413
2015-05-15ops.cc (stat_type): Define alias for struct stat and use throughout the file.Jonathan Wakely5-0/+297
* src/filesystem/ops.cc (stat_type): Define alias for struct stat and use throughout the file. (make_file_type): New function. (file_size(const path&, error_code&)): Report an error for anything that isn't a regular file. (status(const path&), symlink_status(const path&)): Do not throw for file_type::not_found. (temp_directory_path()): Check additional environment variables. * testsuite/experimental/filesystem/operations/exists.cc: New. * testsuite/experimental/filesystem/operations/file_size.cc: New. * testsuite/experimental/filesystem/operations/status.cc: New. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: New. From-SVN: r223224
2015-05-14re PR libstdc++/66055 (hash containers missing required reserving constructors)Nathan Myers4-0/+120
2015-05-14 Nathan Myers <ncm@cantrip.org> Jonathan Wakely <jwakely@redhat.com> PR libstdc++/66055 * include/std/unordered_map (unordered_map, unordered_multimap): Add missing constructors. * include/std/unordered_set (unordered_set, unordered_multiset): Likewise. * testsuite/23_containers/unordered_map/cons/66055.cc: New. * testsuite/23_containers/unordered_multimap/cons/66055.cc: New. * testsuite/23_containers/unordered_multiset/cons/66055.cc: New. * testsuite/23_containers/unordered_set/cons/66055.cc: New. Co-Authored-By: Jonathan Wakely <jwakely@redhat.com> From-SVN: r223198
2015-05-13shared_ptr_base.h (__shared_count(unique_ptr&&)): Check for nullptr (LWG 2415).Jonathan Wakely3-4/+16
* include/bits/shared_ptr_base.h (__shared_count(unique_ptr&&)): Check for nullptr (LWG 2415). * testsuite/20_util/shared_ptr/cons/unique_ptr_deleter.cc: Test construction from empty unique_ptr. * testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error. * testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise. From-SVN: r223170
2015-05-13stl_raw_storage_iter.h (raw_storage_iterator::base()): Define (LWG 2454).Jonathan Wakely1-0/+36
* include/bits/stl_raw_storage_iter.h (raw_storage_iterator::base()): Define (LWG 2454). * testsuite/20_util/raw_storage_iterator/base.cc: New. From-SVN: r223162
2015-05-13tuple (apply): Handle pointers to member (LWG 2418).Jonathan Wakely1-0/+14
* include/experimental/tuple (apply): Handle pointers to member (LWG 2418). * include/std/functional (_Mem_fn_base): Make constructors constexpr. (_Maybe_wrap_member_pointer::__do_wrap): Make constexpr. * testsuite/experimental/tuple/apply.cc: Test pointer to member. From-SVN: r223158
2015-05-13alloc_traits.h (_S_max_size): Implement LWG 2466.Jonathan Wakely11-11/+22
* include/bits/alloc_traits.h (_S_max_size): Implement LWG 2466. * testsuite/20_util/allocator_traits/members/max_size.cc: Adjust. * testsuite/23_containers/forward_list/allocator/minimal.cc: Likewise. * testsuite/23_containers/map/allocator/minimal.cc: Likewise. * testsuite/23_containers/multimap/allocator/minimal.cc: Likewise. * testsuite/23_containers/multiset/allocator/minimal.cc: Likewise. * testsuite/23_containers/set/allocator/minimal.cc: Likewise. * testsuite/23_containers/unordered_map/allocator/minimal.cc: Likewise. * testsuite/23_containers/unordered_multimap/allocator/minimal.cc: Likewise. * testsuite/23_containers/unordered_multiset/allocator/minimal.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/minimal.cc: Likewise. * testsuite/util/testsuite_allocator.h: Remove unused parameter. From-SVN: r223154
2015-05-13libstdc++: Bump to automake 1.11.6Michael Haubenwallner1-7/+35
2015-05-13 Michael Haubenwallner <michael.haubenwallner@ssi-schaefer.com> * Makefile.in: Regenerated with automake-1.11.6. * aclocal.m4: Likewise. * configure: Likewise. * doc/Makefile.in: Likewise. * include/Makefile.in: Likewise. * libsupc++/Makefile.in: Likewise. * po/Makefile.in: Likewise. * python/Makefile.in: Likewise. * src/Makefile.in: Likewise. * src/c++11/Makefile.in: Likewise. * src/c++98/Makefile.in: Likewise. * src/filesystem/Makefile.in: Likewise. * testsuite/Makefile.in: Likewise. From-SVN: r223125
2015-05-09synopsis.cc: Add _GLIBCXX14_CONSTEXPR.Jason Merrill2-0/+20
* testsuite/20_util/headers/functional/synopsis.cc: Add _GLIBCXX14_CONSTEXPR. * testsuite/25_algorithms/headers/algorithm/synopsis.cc: Likewise. From-SVN: r222975
2015-05-09std_c++0x_neg.cc: Add -std=c++98.Jason Merrill41-24/+79
* testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/1.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/2.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/3.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/4.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/5.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/6.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/7.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/3946.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/assign_neg.cc: Add -std=c++98. * testsuite/20_util/auto_ptr/requirements/explicit_instantiation/1.cc: Likewise. * testsuite/20_util/headers/functional/synopsis.cc: Add -Wno-deprecated. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust expected errors. * testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc: Likewise. * testsuite/23_containers/list/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/ext/array_allocator/1.cc: Add -Wno-deprecated. * testsuite/ext/array_allocator/2.cc: Add -Wno-deprecated. * testsuite/ext/array_allocator/26875.cc: Add -Wno-deprecated. * testsuite/ext/array_allocator/3.cc: Add -Wno-deprecated. * testsuite/ext/array_allocator/check_allocate_max_size.cc: Add -Wno-deprecated. * testsuite/ext/array_allocator/check_deallocate_null.cc: Add -Wno-deprecated. * testsuite/ext/array_allocator/check_delete.cc: Add -Wno-deprecated. * testsuite/ext/array_allocator/check_new.cc: Add -Wno-deprecated. * testsuite/ext/profile/mutex_extensions_neg.cc: Prune follow-on error. * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr.cc: Add -std=c++98. * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_neg.cc: Add -std=c++98. * testsuite/tr1/2_general_utilities/shared_ptr/assign/auto_ptr_rvalue_neg.cc: Add -std=c++98. * testsuite/tr1/2_general_utilities/shared_ptr/cons/43820_neg.cc: Add -std=c++98 -fno-show-column. * testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr.cc: Add -std=c++98. * testsuite/tr1/2_general_utilities/shared_ptr/cons/auto_ptr_neg.cc: Add -std=c++98. * testsuite/tr1/6_containers/utility/pair.cc: Add -std=c++98. * testsuite/tr1/8_c_compatibility/cmath/pow_cmath.cc: Add -std=c++98. From-SVN: r222965
2015-05-05c.opt (Wterminate): New.Jason Merrill2-2/+2
gcc/c-family/ * c.opt (Wterminate): New. gcc/cp/ * cp-gimplify.c (cp_genericize_r): Track TRY_BLOCK and MUST_NOT_THROW_EXPR, warn about a THROW_EXPR directly within a MUST_NOT_THROW_EXPR. (cp_genericize_data): Add try_block field. (cp_genericize_tree): Initialize it. * except.c (expand_end_catch_block): Set TREE_NO_WARNING on implicit rethrow. From-SVN: r222842
2015-05-02any (any::_Storage): Fix alignment of buffer.Jonathan Wakely2-1/+53
* include/experimental/any (any::_Storage): Fix alignment of buffer. (any::_Internal): Check alignment of type. * testsuite/experimental/any/cons/aligned.cc: New. * testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error. From-SVN: r222729
2015-05-02iterator: New.Jonathan Wakely3-0/+169
* include/experimental/iterator: New. Define ostream_joiner. * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * testsuite/experimental/iterator/make_ostream_joiner.cc: New. * testsuite/experimental/iterator/ostream_joiner.cc: New. * testsuite/experimental/iterator/requirements.cc: New. * doc/xml/manual/status_cxx2017.xml: Update status. * doc/html/manual/status.html: Regenerate. From-SVN: r222727
2015-05-02numeric: New.Jonathan Wakely2-0/+60
* include/experimental/numeric: New. Define gcd and lcm. * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * testsuite/experimental/numeric/gcd.cc: New. * testsuite/experimental/numeric/lcm.cc: New. * doc/xml/manual/status_cxx2017.xml: Update status. * doc/html/manual/status.html: Regenerate. From-SVN: r222724
2015-05-02any (any::_Storage): Make non-copyable.Jonathan Wakely2-1/+76
* include/experimental/any (any::_Storage): Make non-copyable. (any::any): Do not copy _Storage object. (any::operator=): Implement more efficiently than swapping. (any::swap): Use new _Op_xfer operation. (any::_Op::_Op_xfer): New enumerator. (_Manager_internal::_S_alloc): Remove unused function. (_Manager_internal::_S_create, _Manager_external::_S_create): Use out parameter instead of returning a _Storage object. (_Manager_internal::_S_manage, _Manager_external::_S_manage): Add _Op_xfer operation for moving and swapping. * testsuite/experimental/any/cons/nontrivial.cc: New. * testsuite/experimental/any/misc/any_cast_neg.cc: Adjust dg-error. From-SVN: r222721
2015-05-02re PR libstdc++/65978 (missing constexpr on std::forward_as_tuple and ↵Jonathan Wakely1-15/+19
std::tie (LWG issues 2275 and 2301)) PR libstdc++/65978 * include/std/tuple (forward_as_tuple, tie): Add constexpr. * testsuite/20_util/tuple/creation_functions/constexpr.cc: Uncomment and fix tests for forward_as_tuple and tie. From-SVN: r222719
2015-05-01Implement observer_ptr.Ville Voutilainen8-0/+503
2015-05-01 Ville Voutilainen <ville.voutilainen@gmail.com> Implement observer_ptr. * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/experimental/memory: New. * testsuite/experimental/memory/observer_ptr/assignment/assign.cc: New. * testsuite/experimental/memory/observer_ptr/cons/cons.cc: New. * testsuite/experimental/memory/observer_ptr/hash/hash.cc: New. * testsuite/experimental/memory/observer_ptr/make_observer.cc: New. * testsuite/experimental/memory/observer_ptr/relops/relops.cc: New. * testsuite/experimental/memory/observer_ptr/requirements.cc: New. * testsuite/experimental/memory/observer_ptr/swap/swap.cc: New. * testsuite/experimental/memory/observer_ptr/typedefs.cc: New. From-SVN: r222706
2015-05-01fs_path.h (path::_List): Use vector instead of list.Jonathan Wakely1-0/+2
* include/experimental/fs_path.h (path::_List): Use vector instead of list. * python/libstdcxx/v6/printers.py (StdExpPathPrinter): Adapt. * src/filesystem/path.cc: Use std::prev instead of decrementing rvalues. Fix whitespace. * testsuite/experimental/filesystem/path/decompose/parent_path.cc: Do not decrement iterators before begin. From-SVN: r222702
2015-05-01fs_dir.h: Fix use of non-reserved names.Jonathan Wakely1-0/+6
* include/experimental/fs_dir.h: Fix use of non-reserved names. * include/experimental/fs_ops.h: Likewise. * include/experimental/fs_path.h: Likewise. * testsuite/lib/libstdc++.exp (check_v3_target_filesystem_ts): Use C++11 when checking for support. From-SVN: r222695
2015-05-01memory (pointer_safety, [...]): Define.Jonathan Wakely1-0/+43
* include/std/memory (pointer_safety, declare_reachable, undeclare_reachable, declare_no_pointers, undeclare_no_pointers, get_pointer_safety): Define. * testsuite/20_util/pointer_safety/1.cc: New. From-SVN: r222674
2015-04-30Implement N4100 File System TSJonathan Wakely45-0/+2346
* acinclude.m4 (GLIBCXX_ENABLE_FILESYSTEM_TS): Define. (GLIBCXX_CHECK_FILESYSTEM_DEPS): Define. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac: Enable filesystem TS and check its dependencies. * include/Makefile.am: Add new headers. * include/Makefile.in: Regenerate. * include/bits/locale_conv.h (__do_str_code_cvt, __str_codecvt_in, __str_codecvt_out): Move code conversion logic from wstring_convert into new global functions. (wstring_convert::to_bytes, wstring_convert::from_bytes): Use new functions. (wstring_convert::_M_conv): Remove. * include/bits/quoted_string.h (_Quoted_string): Split out of iomanip. * include/experimental/filesystem: New. * include/experimental/fs_dir.h: New. * include/experimental/fs_fwd.h: New. * include/experimental/fs_ops.h: New. * include/experimental/fs_path.h: New. * include/std/iomanip (_Quoted_string): Move to bits/quoted_string.h. * python/libstdcxx/v6/printers.py (StdExpPathPrinter): Add. * src/Makefile.am (SUBDIRS): Add filesystem. * src/Makefile.in: Regenerate. * src/filesystem/Makefile.am: New. * src/filesystem/Makefile.in: New. * src/filesystem/dir.cc: New. * src/filesystem/ops.cc: New. * src/filesystem/path.cc: New. * testsuite/experimental/filesystem/operations/absolute.cc: New. * testsuite/experimental/filesystem/operations/copy.cc: New. * testsuite/experimental/filesystem/operations/current_path.cc: New. * testsuite/experimental/filesystem/path/append/path.cc: New. * testsuite/experimental/filesystem/path/assign/assign.cc: New. * testsuite/experimental/filesystem/path/assign/copy.cc: New. * testsuite/experimental/filesystem/path/compare/compare.cc: New. * testsuite/experimental/filesystem/path/compare/path.cc: New. * testsuite/experimental/filesystem/path/compare/strings.cc: New. * testsuite/experimental/filesystem/path/concat/path.cc: New. * testsuite/experimental/filesystem/path/concat/strings.cc: New. * testsuite/experimental/filesystem/path/construct/copy.cc: New. * testsuite/experimental/filesystem/path/construct/default.cc: New. * testsuite/experimental/filesystem/path/construct/locale.cc: New. * testsuite/experimental/filesystem/path/construct/range.cc: New. * testsuite/experimental/filesystem/path/decompose/extension.cc: New. * testsuite/experimental/filesystem/path/decompose/filename.cc: New. * testsuite/experimental/filesystem/path/decompose/parent_path.cc: New. * testsuite/experimental/filesystem/path/decompose/relative_path.cc: New. * testsuite/experimental/filesystem/path/decompose/root_directory.cc: New. * testsuite/experimental/filesystem/path/decompose/root_name.cc: New. * testsuite/experimental/filesystem/path/decompose/root_path.cc: New. * testsuite/experimental/filesystem/path/decompose/stem.cc: New. * testsuite/experimental/filesystem/path/generic/generic_string.cc: New. * testsuite/experimental/filesystem/path/itr/traversal.cc: New. * testsuite/experimental/filesystem/path/modifiers/clear.cc: New. * testsuite/experimental/filesystem/path/modifiers/make_preferred.cc: New. * testsuite/experimental/filesystem/path/modifiers/remove_filename.cc: New. * testsuite/experimental/filesystem/path/modifiers/replace_extension.cc: New. * testsuite/experimental/filesystem/path/modifiers/replace_filename.cc: New. * testsuite/experimental/filesystem/path/modifiers/swap.cc: New. * testsuite/experimental/filesystem/path/nonmember/hash_value.cc: New. * testsuite/experimental/filesystem/path/query/empty.cc: New. * testsuite/experimental/filesystem/path/query/has_extension.cc: New. * testsuite/experimental/filesystem/path/query/has_filename.cc: New. * testsuite/experimental/filesystem/path/query/has_parent_path.cc: New. * testsuite/experimental/filesystem/path/query/has_relative_path.cc: New. * testsuite/experimental/filesystem/path/query/has_root_directory.cc: New. * testsuite/experimental/filesystem/path/query/has_root_name.cc: New. * testsuite/experimental/filesystem/path/query/has_root_path.cc: New. * testsuite/experimental/filesystem/path/query/has_stem.cc: New. * testsuite/experimental/filesystem/path/query/is_relative.cc: New. * testsuite/util/testsuite_fs.h: New. From-SVN: r222654