Edward Smith-Rowland
77cba5af77
Implement N3762 string_view: a non-owning reference to a string.
...
2013-11-16 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement N3762 string_view: a non-owning reference to a string.
* include/Makefile.am: Add string_view and string_view.tcc.
* include/Makefile.in: Regenerate.
* include/experimental/string_view: Implement basic_string_view.
* include/experimental/string_view.tcc: Implement basic_string_view.
* testsuite/experimental/string_view/capacity/1.cc: New.
* testsuite/experimental/string_view/cons/char/1.cc: New.
* testsuite/experimental/string_view/cons/char/2.cc: New.
* testsuite/experimental/string_view/cons/char/3.cc: New.
* testsuite/experimental/string_view/cons/wchar_t/1.cc: New.
* testsuite/experimental/string_view/cons/wchar_t/2.cc: New.
* testsuite/experimental/string_view/cons/wchar_t/3.cc: New.
* testsuite/experimental/string_view/element_access/char/1.cc: New.
* testsuite/experimental/string_view/element_access/char/2.cc: New.
* testsuite/experimental/string_view/element_access/char/empty.cc: New.
* testsuite/experimental/string_view/element_access/char/front_back.cc:
New.
* testsuite/experimental/string_view/element_access/wchar_t/1.cc: New.
* testsuite/experimental/string_view/element_access/wchar_t/2.cc: New.
* testsuite/experimental/string_view/element_access/wchar_t/empty.cc:
New.
* testsuite/experimental/string_view/element_access/wchar_t/
front_back.cc: New.
* testsuite/experimental/string_view/include.cc: New.
* testsuite/experimental/string_view/inserters/char/1.cc: New.
* testsuite/experimental/string_view/inserters/char/2.cc: New.
* testsuite/experimental/string_view/inserters/char/3.cc: New.
* testsuite/experimental/string_view/inserters/pod/10081-out.cc: New.
* testsuite/experimental/string_view/inserters/wchar_t/1.cc: New.
* testsuite/experimental/string_view/inserters/wchar_t/2.cc: New.
* testsuite/experimental/string_view/inserters/wchar_t/3.cc: New.
* testsuite/experimental/string_view/literals/types.cc: New.
* testsuite/experimental/string_view/literals/values.cc: New.
* testsuite/experimental/string_view/modifiers/remove_prefix/char/1.cc:
New.
* testsuite/experimental/string_view/modifiers/remove_prefix/wchar_t/
1.cc: New.
* testsuite/experimental/string_view/modifiers/remove_suffix/char/1.cc:
New.
* testsuite/experimental/string_view/modifiers/remove_suffix/wchar_t/
1.cc: New.
* testsuite/experimental/string_view/operations/compare/char/1.cc: New.
* testsuite/experimental/string_view/operations/compare/char/13650.cc:
New.
* testsuite/experimental/string_view/operations/compare/wchar_t/1.cc:
New.
* testsuite/experimental/string_view/operations/compare/wchar_t/
13650.cc: New.
* testsuite/experimental/string_view/operations/data/char/1.cc: New.
* testsuite/experimental/string_view/operations/data/wchar_t/1.cc: New.
* testsuite/experimental/string_view/operations/find/char/1.cc: New.
* testsuite/experimental/string_view/operations/find/char/2.cc: New.
* testsuite/experimental/string_view/operations/find/char/3.cc: New.
* testsuite/experimental/string_view/operations/find/char/4.cc: New.
* testsuite/experimental/string_view/operations/find/wchar_t/1.cc: New.
* testsuite/experimental/string_view/operations/find/wchar_t/2.cc: New.
* testsuite/experimental/string_view/operations/find/wchar_t/3.cc: New.
* testsuite/experimental/string_view/operations/find/wchar_t/4.cc: New.
* testsuite/experimental/string_view/operations/rfind/char/1.cc: New.
* testsuite/experimental/string_view/operations/rfind/char/2.cc: New.
* testsuite/experimental/string_view/operations/rfind/char/3.cc: New.
* testsuite/experimental/string_view/operations/rfind/wchar_t/1.cc: New.
* testsuite/experimental/string_view/operations/rfind/wchar_t/2.cc: New.
* testsuite/experimental/string_view/operations/rfind/wchar_t/3.cc: New.
* testsuite/experimental/string_view/operations/substr/char/1.cc: New.
* testsuite/experimental/string_view/operations/substr/wchar_t/1.cc:
New.
* testsuite/experimental/string_view/operators/char/2.cc: New.
* testsuite/experimental/string_view/operators/wchar_t/2.cc: New.
* testsuite/experimental/string_view/range_access/char/1.cc: New.
* testsuite/experimental/string_view/range_access/wchar_t/1.cc: New.
* testsuite/experimental/string_view/requirements/
explicit_instantiation/1.cc: New.
* testsuite/experimental/string_view/requirements/
explicit_instantiation/char/1.cc: New.
* testsuite/experimental/string_view/requirements/
explicit_instantiation/char16_t/1.cc: New.
* testsuite/experimental/string_view/requirements/
explicit_instantiation/char32_t/1.cc: New.
* testsuite/experimental/string_view/requirements/
explicit_instantiation/wchar_t/1.cc: New.
* testsuite/experimental/string_view/requirements/typedefs.cc: New.
* testsuite/experimental/string_view/types/1.cc: New.
From-SVN: r204902
2013-11-16 17:44:48 +00:00
Jonathan Wakely
3aaaa651a9
stl_bvector.h (vector<bool>::emplace_back()): LWG 2187: Define.
...
* include/bits/stl_bvector.h (vector<bool>::emplace_back()): LWG 2187:
Define.
(vector<bool>::emplace()): Likewise.
* testsuite/23_containers/vector/bool/emplace.cc: New.
From-SVN: r204851
2013-11-15 16:34:06 +00:00
Ondřej Bílka
64e1ab1168
build_hacking.xml: Fix documentation typos.
...
2013-11-15 Ondřej Bílka <neleai@seznam.cz>
Jonathan Wakely <jwakely.gcc@gmail.com>
* doc/xml/manual/build_hacking.xml: Fix documentation typos.
* doc/xml/manual/configure.xml: Likewise.
* include/bits/atomic_base.h: Fix typos in comments.
* include/bits/random.h: Likewise.
* include/ext/cast.h: Likewise.
* libsupc++/cxxabi.h: Likewise.
* testsuite/ext/pb_ds/example/hash_illegal_resize.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/special_functions/testcase.h:
Likewise.
* testsuite/util/exception/safety.h: Likewise.
* testsuite/util/testsuite_containers.h: Likewise.
* testsuite/util/testsuite_hooks.cc: Likewise.
Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com>
From-SVN: r204850
2013-11-15 16:33:59 +00:00
Jonathan Wakely
ff90a89e48
stl_map.h (map): Implement C++11 allocator-aware container requirements.
...
* include/bits/stl_map.h (map): Implement C++11 allocator-aware
container requirements.
* include/bits/stl_multimap.h (multimap): Likewise.
* include/bits/stl_multiset.h (multiset): Likewise.
* include/bits/stl_set.h (set): Likewise.
* include/bits/stl_tree.h (_Rb_tree_node): Use __aligned_buffer and
add accessors for value.
(_Rb_tree_iterator, _Rb_tree_const_iterator): Use _Rb_tree_node
accessors.
(_Rb_tree): Use allocator_traits and implement support for sets and
maps the be allocator-aware.
* include/bits/forward_list.h (_Fwd_list_base::_M_create_node): Do
not zero-initialize storage buffer.
* include/bits/hashtable_policy.h (_Hashtable_alloc::_M_allocate_node):
Likewise.
* include/bits/stl_vector.h (vector(vector&&, const allocator_type&)):
Add conditional noexcept specification.
* doc/xml/manual/status_cxx2011.xml: Update status of containers.
* testsuite/util/testsuite_allocator.h: Re-indent.
* testsuite/23_containers/forward_list/allocator/copy.cc: Test
allocator-extended copy constructor.
* testsuite/23_containers/unordered_map/allocator/copy.cc: Likewise.
* testsuite/23_containers/unordered_multimap/allocator/copy.cc:
Likewise.
* testsuite/23_containers/unordered_multiset/allocator/copy.cc:
Likewise.
* testsuite/23_containers/unordered_set/allocator/copy.cc: Likewise.
* testsuite/23_containers/vector/allocator/copy.cc: Likewise.
* testsuite/23_containers/forward_list/allocator/move.cc: New.
* testsuite/23_containers/unordered_map/allocator/move.cc: New.
* testsuite/23_containers/unordered_multimap/allocator/move.cc: New.
* testsuite/23_containers/unordered_multiset/allocator/move.cc: New.
* testsuite/23_containers/unordered_set/allocator/move.cc: New.
* testsuite/23_containers/vector/allocator/move.cc: New.
* testsuite/23_containers/map/allocator/copy.cc: New.
* testsuite/23_containers/map/allocator/copy_assign.cc: New.
* testsuite/23_containers/map/allocator/minimal.cc: New.
* testsuite/23_containers/map/allocator/move.cc: New.
* testsuite/23_containers/map/allocator/move_assign.cc: New.
* testsuite/23_containers/map/allocator/noexcept.cc: New.
* testsuite/23_containers/map/allocator/swap.cc: New.
* testsuite/23_containers/multimap/allocator/copy.cc: New.
* testsuite/23_containers/multimap/allocator/copy_assign.cc: New.
* testsuite/23_containers/multimap/allocator/minimal.cc: New.
* testsuite/23_containers/multimap/allocator/move.cc: New.
* testsuite/23_containers/multimap/allocator/move_assign.cc: New.
* testsuite/23_containers/multimap/allocator/noexcept.cc: New.
* testsuite/23_containers/multimap/allocator/swap.cc: New.
* testsuite/23_containers/multiset/allocator/copy.cc: New.
* testsuite/23_containers/multiset/allocator/copy_assign.cc: New.
* testsuite/23_containers/multiset/allocator/minimal.cc: New.
* testsuite/23_containers/multiset/allocator/move.cc: New.
* testsuite/23_containers/multiset/allocator/move_assign.cc: New.
* testsuite/23_containers/multiset/allocator/noexcept.cc: New.
* testsuite/23_containers/multiset/allocator/swap.cc: New.
* testsuite/23_containers/set/allocator/copy.cc: New.
* testsuite/23_containers/set/allocator/copy_assign.cc: New.
* testsuite/23_containers/set/allocator/minimal.cc: New.
* testsuite/23_containers/set/allocator/move.cc: New.
* testsuite/23_containers/set/allocator/move_assign.cc: New.
* testsuite/23_containers/set/allocator/noexcept.cc: New.
* testsuite/23_containers/set/allocator/swap.cc: New.
* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
Adjust dg-error line number.
* 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: r204848
2013-11-15 15:34:14 +00:00
Jonathan Wakely
8ed13e2757
alloc_traits.h (__allow_copy_cons): Remove.
...
* include/bits/alloc_traits.h (__allow_copy_cons): Remove.
(__check_copy_constructible): Likewise.
* include/bits/unordered_map.h (unordered_map, unordered_multimap):
Do not derive from __check_copy_constructible.
* include/bits/unordered_set.h (unordered_set, unordered_multiset):
Likewise.
* testsuite/23_containers/unordered_map/55043.cc: It is no longer
necessary for is_copy_constructible to be correct to use nested
unordered containers.
* testsuite/23_containers/unordered_multimap/55043.cc: Likewise.
* testsuite/23_containers/unordered_set/55043.cc: Likewise.
* testsuite/23_containers/unordered_multiset/55043.cc: Likewise.
From-SVN: r204790
2013-11-14 12:43:00 +00:00
Marc Glisse
b62c62f4b0
re PR libstdc++/59087 (Issues including complex.h in C++11/1y mode because of C's complex.h)
...
2013-11-13 Marc Glisse <marc.glisse@inria.fr>
PR libstdc++/59087
* include/ext/pod_char_traits.h: Uglify V, I and S.
From-SVN: r204750
2013-11-13 15:47:04 +00:00
Jonathan Wakely
6162239973
re PR libstdc++/54562 (mutex and condition variable timers)
...
PR libstdc++/54562
* include/std/mutex (__timed_mutex_impl::__clock_t): Use
high_resolution_clock for absolute timeouts, because
pthread_mutex_timedlock uses CLOCK_REALTIME not CLOCK_MONOTONIC.
(__timed_mutex_impl::_M_try_lock_for): Use steady_clock for relative
timeouts as per [thread.req.timing].
(__timed_mutex_impl::_M_try_lock_until<Clock,Duration>): Convert to
__clock_t time point instead of using _M_try_lock_for.
From-SVN: r204672
2013-11-11 13:33:48 +00:00
Jonathan Wakely
5275f3e546
re PR libstdc++/58982 (std::vector<std::atomic<int>> vai(10); does not compile anymore)
...
PR libstdc++/58982
* include/bits/stl_algobase.h (__copy_move::__copy_m): Use assertion
to prevent using memmove() on non-assignable types.
(__copy_move_backward::__copy_move_b): Likewise.
* include/bits/stl_uninitialized.h (uninitialized_copy
uninitialized_copy_n, uninitialized_fill, uninitialized_fill_n,
__uninitialized_default, __uninitialized_default_n): Check for
assignable as well as trivial.
* testsuite/20_util/specialized_algorithms/uninitialized_copy/
58982.cc: New.
* testsuite/20_util/specialized_algorithms/uninitialized_copy_n/
58982.cc: New.
* testsuite/20_util/specialized_algorithms/uninitialized_fill/
58982.cc: New.
* testsuite/20_util/specialized_algorithms/uninitialized_fill_n/
58982.cc: New.
* testsuite/25_algorithms/copy/58982.cc: New.
* testsuite/25_algorithms/copy_n/58982.cc: New.
From-SVN: r204615
2013-11-09 12:38:00 +00:00
François Dumont
9fc0e24b6c
safe_iterator.h (_BeforeBeginHelper<>::_S_Is): Take only a const safe iterator reference.
...
2013-11-08 François Dumont <fdumont@gcc.gnu.org>
* include/debug/safe_iterator.h (_BeforeBeginHelper<>::_S_Is):
Take only a const safe iterator reference.
(_BeforeBeginHelper<>::_S_Is_beginnest): Likewise.
(__get_distance): Take only one type of iterator.
(_Safe_iterator<>::_M_valid_range<>): Not template anymore.
(_Safe_iterator<>::_M_get_sequence()): Return pointer to const
sequence from a const_iterator and a pointer to sequence from an
iterator.
* include/debug/safe_iterator.tcc: Adapt.
* include/debug/safe_local_iterator.h
(_Safe_local_iterator<>::_M_valid_range<>): Not template anymore.
(_Safe_local_iterator<>::_M_get_sequence()): Return pointer to
const sequence from a const_iterator and a pointer to sequence
from an iterator.
* include/debug/safe_local_iterator.tcc: Adapt.
* include/debug/forward_list
(_BeforeBeginHelper<std::__debug::forward_list<>>): Adapt.
From-SVN: r204598
2013-11-08 21:03:58 +00:00
Jonathan Wakely
e15c474a34
regex_compiler.h (__detail::__has_contiguous_iter): vector<bool> storage is not contiguous.
...
* include/bits/regex_compiler.h (__detail::__has_contiguous_iter):
vector<bool> storage is not contiguous.
From-SVN: r204582
2013-11-08 17:33:31 +00:00
Jonathan Wakely
34d1ff06bf
regex_compiler.h (__detail::__compile_nfa): Overload so that std::basic_string<C> and std::vector<C> iterators dispatch to...
...
* include/bits/regex_compiler.h (__detail::__compile_nfa): Overload
so that std::basic_string<C> and std::vector<C> iterators dispatch to
the const C* compiler.
From-SVN: r204574
2013-11-08 14:30:40 +00:00
Jonathan Wakely
bb038ece8f
regex_compiler.h (__detail::_AnyMatcher, [...]): Remove redundant _CharT template parameters.
...
* include/bits/regex_compiler.h (__detail::_AnyMatcher,
__detail::_CharMatcher, __detail::_BracketMatcher): Remove redundant
_CharT template parameters.
* include/bits/regex_compiler.tcc: Likewise.
From-SVN: r204573
2013-11-08 14:30:34 +00:00
Jonathan Wakely
68e69ce27f
regex_automaton.h (__detail::_State, [...]): Remove redundant _CharT template parameters.
...
* include/bits/regex_automaton.h (__detail::_State, __detail::_NFA,
__detail::_StateSeq): Remove redundant _CharT template parameters.
* include/bits/regex_automaton.tcc: Likewise.
* include/bits/regex_compiler.h (__detail::_Compiler): Likewise.
(__compile_nfa): Add object generator for _Compiler.
* include/bits/regex_compiler.tcc: Remove _CharT template parameters.
* include/bits/regex_executor.h: Likewise.
* include/bits/regex_executor.tcc: Likewise.
* include/bits/regex.h (basic_regex): Assert char_type matches. Use
__compile_nfa object generator. Remove _CharT template parameter.
From-SVN: r204572
2013-11-08 14:30:29 +00:00
Jonathan Wakely
7d9d218516
regex_automaton.h (__detail::_State): Split non-dependent parts into new _State_base.
...
* include/bits/regex_automaton.h (__detail::_State): Split
non-dependent parts into new _State_base.
(__detail::_NFA): Likewise for _NFA_base. Use std::move() to avoid
copies when inserting _MatcherT and _StateT objects.
* include/bits/regex_automaton.tcc: Move member definitions to base
class. Qualify dependent names.
* include/bits/regex_compiler.h (__detail::_Compiler::_M_get_nfa): Make
non-const and use std::move to avoid copying.
* include/bits/regex_compiler.tcc: Likewise.
* include/bits/regex_executor.h (__detail::_Executor::_M_is_word): Use
array, so past-the-end iterator is valid.
From-SVN: r204571
2013-11-08 14:30:22 +00:00
Jonathan Wakely
f054ff5b7c
regex_automaton.h (_S_opcode_word_boundry): Rename to _S_opcode_word_boundary.
...
* include/bits/regex_automaton.h (_S_opcode_word_boundry): Rename to
_S_opcode_word_boundary.
* include/bits/regex_automaton.tcc: Likewise.
* include/bits/regex_executor.h (__detail::_Executor::_M_word_boundry):
Rename to _M_word_boundary.
* include/bits/regex_executor.tcc: Likewise.
From-SVN: r204449
2013-11-06 09:47:51 +00:00
Jonathan Wakely
4457e88ce1
N3655 C++1y TransformationTraits Redux
...
N3655 C++1y TransformationTraits Redux
* include/std/type_traits (remove_const_t, remove_volatile_t,
remove_cv_t, add_const_t, add_volatile_t, add_cv_t, remove_reference_t,
add_lvalue_reference_t, add_rvalue_reference_t, make_signed_t,
make_unsigned_t, remove_extent_t, remove_all_extents_t,
remove_pointer_t, add_pointer_t, aligned_storage_t, decay_t,
enable_if_t, conditional_t, common_type_t, underlying_type_t,
result_of_t): Define.
* doc/xml/manual/status_cxx2014.xml: Update.
* testsuite/20_util/add_lvalue_reference/requirements/typedefs-3.cc:
New.
* testsuite/20_util/add_rvalue_reference/requirements/typedefs-3.cc:
New.
* testsuite/20_util/common_type/requirements/typedefs-3.cc: New.
* testsuite/20_util/conditional/requirements/typedefs-2.cc: New.
* testsuite/20_util/decay/requirements/typedefs-2.cc: New.
* testsuite/20_util/enable_if/requirements/typedefs-2.cc: New.
* testsuite/20_util/make_signed/requirements/typedefs-3.cc: New.
* testsuite/20_util/make_unsigned/requirements/typedefs-3.cc: New.
* testsuite/20_util/remove_reference/requirements/typedefs.cc: New.
* testsuite/20_util/result_of/requirements/typedefs.cc: New.
* testsuite/20_util/underlying_type/requirements/typedefs-3.cc: New.
* testsuite/20_util/common_type/requirements/typedefs-2.cc: Change to
compile-only test.
* testsuite/20_util/decay/requirements/typedefs.cc: Likewise.
* testsuite/20_util/make_signed/requirements/typedefs-1.cc: Likewise.
* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
line number.
* testsuite/20_util/make_signed/requirements/typedefs_neg.cc:
Likewise.
* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
Likewise.
From-SVN: r204426
2013-11-05 22:57:36 +00:00
Jonathan Wakely
b1705a6388
optional: Use __and_<> and __not_<> in conditions.
...
2013-11-05 Jonathan Wakely <jwakely.gcc@gmail.com>
Paolo Carlini <paolo.carlini@oracle.com>
* include/experimental/optional: Use __and_<> and __not_<> in
conditions. Style fixes.
(__constexpr_addressof, swap): Make inline.
* testsuite/experimental/optional/cons/copy.cc: Adjust constants for
32-bit targets.
* testsuite/experimental/optional/cons/move.cc: Likewise.
* testsuite/experimental/optional/cons/value.cc: Likewise.
* testsuite/experimental/optional/constexpr/cons/value.cc: Likewise.
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r204402
2013-11-05 15:24:08 +00:00
Michael Brune
2b5ab1e438
enable_special_members.h: New.
...
2013-10-31 Michael Brune <lucdanton@free.fr>
* include/bits/enable_special_members.h: New.
* include/experimental/optional: New.
* include/Makefile.am: Handle include/experimental.
* include/Makefile.in: Regenerate.
* testsuite/libstdc++-dg/conformance.exp: Run tests from
testsuite/experimental sub-directory.
* testsuite/experimental/optional/assignment/1.cc: New.
* testsuite/experimental/optional/assignment/2.cc: New.
* testsuite/experimental/optional/assignment/3.cc: New.
* testsuite/experimental/optional/assignment/4.cc: New.
* testsuite/experimental/optional/assignment/5.cc: New.
* testsuite/experimental/optional/assignment/6.cc: New.
* testsuite/experimental/optional/cons/copy.cc: New.
* testsuite/experimental/optional/cons/default.cc: New.
* testsuite/experimental/optional/cons/move.cc: New.
* testsuite/experimental/optional/cons/value.cc: New.
* testsuite/experimental/optional/constexpr/cons/default.cc: New.
* testsuite/experimental/optional/constexpr/cons/value.cc: New.
* testsuite/experimental/optional/constexpr/in_place.cc: New.
* testsuite/experimental/optional/constexpr/make_optional.cc: New.
* testsuite/experimental/optional/constexpr/nullopt.cc: New.
* testsuite/experimental/optional/constexpr/observers/1.cc: New.
* testsuite/experimental/optional/constexpr/observers/2.cc: New.
* testsuite/experimental/optional/constexpr/observers/3.cc: New.
* testsuite/experimental/optional/constexpr/observers/4.cc: New.
* testsuite/experimental/optional/constexpr/observers/5.cc: New.
* testsuite/experimental/optional/constexpr/relops/1.cc: New.
* testsuite/experimental/optional/constexpr/relops/2.cc: New.
* testsuite/experimental/optional/constexpr/relops/3.cc: New.
* testsuite/experimental/optional/constexpr/relops/4.cc: New.
* testsuite/experimental/optional/constexpr/relops/5.cc: New.
* testsuite/experimental/optional/constexpr/relops/6.cc: New.
* testsuite/experimental/optional/in_place.cc: New.
* testsuite/experimental/optional/make_optional.cc: New.
* testsuite/experimental/optional/nullopt.cc: New.
* testsuite/experimental/optional/observers/1.cc: New.
* testsuite/experimental/optional/observers/2.cc: New.
* testsuite/experimental/optional/observers/3.cc: New.
* testsuite/experimental/optional/observers/4.cc: New.
* testsuite/experimental/optional/observers/5.cc: New.
* testsuite/experimental/optional/relops/1.cc: New.
* testsuite/experimental/optional/relops/2.cc: New.
* testsuite/experimental/optional/relops/3.cc: New.
* testsuite/experimental/optional/relops/4.cc: New.
* testsuite/experimental/optional/relops/5.cc: New.
* testsuite/experimental/optional/relops/6.cc: New.
* testsuite/experimental/optional/requirements.cc: New.
* testsuite/experimental/optional/swap/1.cc: New.
From-SVN: r204299
2013-11-01 20:08:39 +00:00
Jonathan Wakely
bef49287da
* include/bits/stl_function.h (logical_not<void>): Add noexcept.
...
From-SVN: r204293
2013-11-01 11:59:51 +00:00
Paolo Carlini
7115d32a36
re PR libstdc++/58952 (Construct "std::getchar()" rejected when getchar is macro in C library)
...
2013-11-01 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58952
* include/c_global/cstdio: Undef getchar.
From-SVN: r204291
2013-11-01 11:10:55 +00:00
Jonathan Wakely
d081231ab5
N3421 C++1y Transparent functors
...
N3421 C++1y Transparent functors
* include/bits/stl_function.h (plus<void>, minus<void>,
multiplies<void>, divides<void>, modulus<void>, negate<void>,
equal_to<void>, not_equal_to<void>, greater<void>, less<void>,
greater_equal<void>, less_equal<void>, logical_and<void>,
logical_or<void>, logical_not<void>, bit_and<void>, bit_or<void>,
bit_xor<void>, bit_not<void>): Define.
* doc/xml/manual/status_cxx2014.xml: Update.
* testsuite/20_util/function_objects/comparisons_void.cc: New.
* include/bits/stl_function.h: Implement N3421.
* testsuite/20_util/function_objects/comparisons_void.cc: New.
From-SVN: r204290
2013-11-01 11:07:15 +00:00
Jonathan Wakely
1b1bdc03f8
tuple (_Index_tuple, [...]): Move to <utility>.
...
* include/std/tuple (_Index_tuple, _Build_index_tuple): Move to
<utility>.
* include/std/utility (integer_sequence, make_integer_sequence,
index_sequence, make_index_sequence, index_sequence_for): Define.
* doc/xml/manual/status_cxx2014.xml: Update.
* testsuite/20_util/integer_sequence/intseq.cc: New.
* testsuite/20_util/integer_sequence/requirements/typedefs.cc: New.
From-SVN: r204275
2013-10-31 19:23:54 +00:00
Edward Smith-Rowland
7057e6452b
Implement C++14 digit separators.
...
libcpp:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* include/cpplib.h (cpp_options): Add digit_separators flag.
* internal.h (DIGIT_SEP(c)): New macro.
* expr.c (cpp_classify_number): Check improper placement of digit sep;
(cpp_interpret_integer): Skip over digit separators.
* init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
digit separator flags per language; (cpp_set_lang): Set
digit_separators
* lex.c (lex_number): Add digits separator to allowable characters for
C++14.
gcc/c-family:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* c-lex.c (interpret_float): Remove digit separators from scratch string
before building real literal.
gcc/testsuite:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* g++.dg/cpp1y/digit-sep.C: New.
* g++.dg/cpp1y/digit-sep-neg.C: New.
* g++.dg/cpp1y/digit-sep-cxx11-neg.C: New.
libstdc++-v3:
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
Implement C++14 digit separators.
* include/include/bits/parse_numbers.h: Change struct _Digit<_Base, '`'>
to struct _Digit<_Base, '\''>.
From-SVN: r204260
2013-10-31 14:01:23 +00:00
Jonathan Wakely
8d52ed5c81
shared_ptr (__shared_ptr): Assert non-void pointer.
...
* include/bits/shared_ptr (__shared_ptr): Assert non-void pointer.
* include/bits/shared_ptr (default_delete): Likewise.
* testsuite/20_util/shared_ptr/cons/58839.cc: Do not use
default_delete<void>.
* testsuite/20_util/shared_ptr/cons/void_neg.cc: New.
* testsuite/20_util/default_delete/void_neg.cc: New.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust line numbers.
* testsuite/20_util/unique_ptr/assign/48635_neg.cc: Likewise.
From-SVN: r204225
2013-10-30 19:48:52 +00:00
Jonathan Wakely
c8c0f5577d
re PR libstdc++/58839 (dereferencing void* in shared_ptr(unique_ptr&& u) constructor)
...
PR libstdc++/58839
* include/bits/shared_ptr_base.h
(__shared_ptr<T>::__shared_ptr(unique_ptr<U,D>&&)): Only use addressof
when unique_ptr<U,D>::pointer is not a built-in pointer type.
* testsuite/20_util/shared_ptr/cons/58839.cc: New.
* testsuite/20_util/enable_shared_from_this/members/assign.cc: New.
* testsuite/20_util/enable_shared_from_this/members/unique_ptr.cc: New.
From-SVN: r204184
2013-10-29 21:33:29 +00:00
Jonathan Wakely
da2e699194
hashtable.cc (__access_protected_ctor): Define and use new type instead of _Hashtable_ebo_helper.
...
* include/bits/hashtable.cc (__access_protected_ctor): Define and use
new type instead of _Hashtable_ebo_helper.
* testsuite/23_containers/unordered_set/
not_default_constructible_hash_neg.cc: Adjust line number.
From-SVN: r204182
2013-10-29 21:19:34 +00:00
Tim Shen
caaf33fa57
regex_executor.tcc: Add comments.
...
2013-10-28 Tim Shen <timshen91@gmail.com>
* regex_executor.tcc: Add comments.
From-SVN: r204117
2013-10-28 03:55:12 +00:00
Tim Shen
9f0d9611e7
regex.h: Remove unnecessary friends.
...
2013-10-26 Tim Shen <timshen91@gmail.com>
* include/bits/regex.h: Remove unnecessary friends.
* include/bits/regex.tcc (__regex_algo_impl<>): Move __get_executor
to here.
* include/bits/regex_executor.h: Remove _DFSExecutor and _BFSExecutor;
they are merged into _Executor. Eliminate quantifier tracking part, so
it's faster.
* include/bits/regex_executor.tcc: Implement _Executor.
* testsuite/28_regex/algorithms/regex_match/ecma/char/ungreedy.cc: New.
* testsuite/28_regex/algorithms/regex_search/ecma/greedy.cc: Adjust
duplicate testcases.
* testsuite/performance/28_regex/split.h: New.
* testsuite/performance/28_regex/split_bfs.cc: New.
* testsuite/util/testsuite_regex.h: Adjust behavior of two-executors
agreement judger: do not compare match_results when executor return
false.
From-SVN: r204093
2013-10-26 16:09:28 +00:00
François Dumont
3ff4317f1c
formatter.h (__check_singular): Add const on iterator reference.
...
2013-10-25 François Dumont <fdumont@gcc.gnu.org>
* include/debug/formatter.h (__check_singular): Add const on
iterator reference.
* include/debug/functions.h (__check_singular): Likewise.
(__check_singular(const _Safe_iterator<_Ite, _Seq>&)): Delete.
(__check_dereferenceable(const _Ite&)): Add const on iterator
reference.
(__check_dereferenceable(const _Safe_local_iterator<>&)): New.
* include/debug/safe_iterator.h (__check_singular_aux): Review
comment.
* testsuite/23_containers/vector/debug/debug_functions.cc: New.
* testsuite/23_containers/unordered_set/debug/debug_functions.cc:
New.
From-SVN: r204075
2013-10-25 19:25:06 +00:00
Jason Merrill
d4c579b561
* include/bits/hashtable.h (_Hashtable): Force EBO for _Hash_code_base.
...
From-SVN: r203984
2013-10-23 14:08:46 -04:00
Paolo Carlini
66caf47a50
re PR libstdc++/58850 (Conversion error in chrono)
...
2013-10-23 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58850
* include/std/chrono (minutes, hours): Change typedefs to uniformly
use int64_t.
* testsuite/20_util/duration/arithmetic/58850.cc: New.
From-SVN: r203978
2013-10-23 15:31:26 +00:00
Paolo Carlini
1a0e9d1cb9
re PR libstdc++/58815 (Casting/Conversion operator for std::decimal not supported)
...
2013-10-23 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58815
* include/decimal/decimal (decimal32::operator long long(),
decimal64::operator long long(), decimal128::operator long long()):
Add in c++11 mode per n3407.
* testsuite/decimal/pr58815.cc: New.
From-SVN: r203956
2013-10-23 11:48:26 +00:00
Edward Smith-Rowland
e9a6449215
basic_string.h (operator""s): Remove space between quotes and literal identifier.
...
2013-10-22 Edward Smith-Rowland <3dw4rd@verizon.net>
* include/bits/basic_string.h (operator""s): Remove space between quotes
and literal identifier.
* include/std/chrono (operator""h, operator""min, operator""s,
operator""ms, operator""us, operator""ns): Ditto.
From-SVN: r203941
2013-10-23 00:12:36 +00:00
Ed Smith-Rowland
ae5543e662
Implement N3779 - User-defined Literals for std::complex, part 2 of UDL for Standard Library Types
...
2013-09-27 Ed Smith-Rowland <3dw4rd@verizon.net>
Implement N3779 - User-defined Literals for std::complex,
part 2 of UDL for Standard Library Types
* include/std/complex: Add complex literal operators.
* testsuite/26_numerics/complex/literals/types.cc: New.
* testsuite/26_numerics/complex/literals/values.cc: New.
From-SVN: r203940
2013-10-23 00:09:19 +00:00
Edward Smith-Rowland
390dafb79d
re PR libstdc++/58804 (dynamic_bitset<> uses popcountl on long long)
...
2013-10-20 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/58804
PR libstdc++/58729
* include/tr2/dynamic_bitset
(__dynamic_bitset_base<_WordT, _Alloc>::_M_are_all_aux,
__dynamic_bitset_base<_WordT, _Alloc>::_M_do_count):
Use __builtin_popcountll() instead of __builtin_popcountl().
* include/tr2/dynamic_bitset.tcc
(__dynamic_bitset_base<_WordT, _Alloc>::_M_do_find_first,
__dynamic_bitset_base<_WordT, _Alloc>::_M_do_find_next):
Use __builtin_ctzll() instead of __builtin_ctzl().
From-SVN: r203893
2013-10-21 13:52:39 +00:00
Tim Shen
603b781be4
regex.h: Remove virtual class _Automaton.
...
2013-10-20 Tim Shen <timshen91@gmail.com>
* include/bits/regex.h: Remove virtual class _Automaton.
* include/bits/regex_automaton.h: Likewise.
* include/bits/regex.tcc: Adjust comment for policy changing.
* include/bits/regex_executor.h: Update comments of complexity.
* include/bits/regex_executor.tcc: Adjust executor choosing
policy. Now DFS executor is the default one.
* testsuite/util/testsuite_regex.h (regex_match_debug,
regex_search_debug): Adjust for policy changing.
From-SVN: r203875
2013-10-20 10:07:29 +00:00
Chris Jefferson
f5b9d5e877
re PR libstdc++/58800 (std::nth_element segfaults on valid input)
...
2013-10-20 Chris Jefferson <chris@bubblescope.net>
Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58800
* include/bits/stl_algo.h (__unguarded_partition_pivot): Change
__last - 2 to __last - 1.
* testsuite/25_algorithms/nth_element/58800.cc: New
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r203872
2013-10-20 09:07:36 +00:00
Edward Smith-Rowland
6b8fe121af
re PR libstdc++/58729 (tr2::dynamic_bitset::resize fails)
...
2013-10-18 Edward Smith-Rowland <3dw4rd@verizon.net>
PR libstdc++/58729
* include/tr2/dynamic_bitset (_M_resize, resize): Use input value
to set bits; (_M_do_left_shift, _M_do_right_shift, _M_do_to_ulong,
_M_do_to_ullong, _M_do_find_first, _M_do_find_next, _M_copy_from_ptr,
operator>>): Move long methods outline to...
* include/tr2/dynamic_bitset.tcc: New.
* include/Makefile.am: Add dynamic_bitset.tcc.
* include/Makefile.in: Add dynamic_bitset.tcc.
* testsuite/tr2/dynamic_bitset/pr58729.cc: New.
From-SVN: r203841
2013-10-19 01:31:19 +00:00
Tim Shen
7948838864
regex_scanner.tcc: (_Scanner<>::_M_scan_normal...
...
2013-10-18 Tim Shen <timshen91@gmail.com>
* include/bits/regex_scanner.tcc: (_Scanner<>::_M_scan_normal,
_Scanner<>::_M_eat_escape_ecma, _Scanner<>::_M_eat_escape_posix,
_Scanner<>::_M_eat_escape_awk): Narrow character before finding in maps.
* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/cjk_match.cc:
New.
From-SVN: r203827
2013-10-18 16:13:07 +00:00
Tim Shen
ab1c993b94
regex.h (regex_token_iterator<>::regex_token_iterator): Fix initialization orders in initialization list and add explicit braces for...
...
2013-10-17 Tim Shen <timshen91@gmail.com>
* include/bits/regex.h (regex_token_iterator<>::regex_token_iterator):
Fix initialization orders in initialization list and add explicit braces
for potentially ambiguous(actually not) `else` branch to eliminate
warnings.
* include/bits/regex_automaton.h (_NFA<>::_NFA): Likewise.
* include/bits/regex_compiler.h (_CharMatcher<>::_CharMatcher,
_BracketMatcher<>::_BracketMatcher): Likewise.
* include/bits/regex_compiler.tcc (_Compiler<>::_Compiler,
_Compiler<>::_M_atom): Likewise.
* include/bits/regex_executor.h (_Executor<>::_Executor): Likewise.
* include/bits/regex_executor.tcc (_DFSExecutor<>::_M_dfs,
_Executor<>::_M_word_boundry): Likewise.
* include/bits/regex_scanner.tcc (_Scanner<>::_Scanner,
_Scanner<>::_M_eat_class): Likewise.
* include/bits/regex.tcc (__regex_algo_impl<>,
regex_iterator<>::operator++): Likewise, and remove unused typedef.
From-SVN: r203798
2013-10-17 20:46:50 +00:00
Tim Shen
703344ca91
regex.h (regex_token_iterator<>::regex_token_iterator): Add initialization for _M_has_m1.
...
2013-10-16 Tim Shen <timshen91@gmail.com>
* include/bits/regex.h (regex_token_iterator<>::regex_token_iterator):
Add initialization for _M_has_m1.
* include/bits/regex.tcc (regex_token_iterator<>::operator=): Add return
statment.
From-SVN: r203732
2013-10-16 22:28:28 +00:00
Tim Shen
96937d47ac
re PR libstdc++/58737 (leak in std::regex_match)
...
2013-10-15 Tim Shen <timshen91@gmail.com>
PR libstdc++/58737
* include/bits/regex_automaton.h (_Automaton<>::~_Automaton): Fix memory
leak by adding it.
* include/bits/regex_executor.h (_Executor<>::~_Executor): Likewise.
From-SVN: r203610
2013-10-15 15:01:44 +00:00
Jonathan Wakely
61bf02e007
re PR libstdc++/58659 (Construction of shared_ptr from unique_ptr mismatches new/delete and std::allocator for __shared_ptr_count)
...
PR libstdc++/58659
* include/bits/shared_ptr_base.h (__shared_count::__shared_count(P,D)):
Delegate to constructor taking allocator.
(__shared_count::_S_create_from_up): Inline into ...
(__shared_count::__shared_count(unique_ptr<Y,D>&&): Here. Use
std::conditional instead of constrained overloads. Allocate memory
using the allocator type that will be used for deallocation.
* testsuite/20_util/shared_ptr/cons/58659.cc: New.
* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust.
From-SVN: r203274
2013-10-08 13:33:37 +01:00
Tim Shen
18971f1fc3
regex_executor.h: Add _TodoList class.
...
2013-10-08 Tim Shen <timshen91@gmail.com>
* include/bits/regex_executor.h: Add _TodoList class.
* include/bits/regex_executor.tcc (_BFSExecutor<>::_M_main): Add
_M_match_stack and _M_stack to make everything faster. Break if
_M_stack is empty, to reduce unnecessary idling.
* testsuite/performance/28_regex/split.cc: New.
From-SVN: r203261
2013-10-08 03:41:14 +00:00
Tim Shen
6cb4308702
regex.h: (regex_token_iterator<>::regex_token_iterator): Fix compile error.
...
2013-10-06 Tim Shen <timshen91@gmail.com>
* include/bits/regex.h: (regex_token_iterator<>::regex_token_iterator):
Fix compile error.
* include/bits/regex.tcc: (regex_replace<>): Remove default parameter.
2013-10-06 Tim Shen <timshen91@gmail.com>
* include/bits/regex.h (__regex_algo_impl<>, regex_match<>,
regex_search<>): New abstract function for regex_match and regex_search.
* include/bits/regex.tcc (__regex_algo_impl<>): Implement.
* include/bits/regex_executor.h
(_Executor<>::_M_lookahead,
_DFSExecutor<>::_M_clone,
_BFSExecutor<>::_M_clone): Let _M_clone to choose which executor to
use.
* include/bits/regex_executor.tcc (__get_executor<>): Update the
definition to support __policy.
* testsuite/28_regex/algorithms/regex_match/awk/cstring_01.cc: Use
*_debug.
* testsuite/28_regex/algorithms/regex_match/basic/empty_range.cc: Same.
* testsuite/28_regex/algorithms/regex_match/basic/string_01.cc: Same.
* testsuite/28_regex/algorithms/regex_match/basic/string_range_00_03.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/basic/string_range_01_03.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/basic/string_range_02_03.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/53622.cc: Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/57173.cc: Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/58576.cc: Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/anymatcher.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/backref.cc: Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/empty_range.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/emptygroup.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/hex.cc: Same.
* testsuite/28_regex/algorithms/regex_match/ecma/char/quoted_char.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/anymatcher.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/ecma/wchar_t/hex.cc: Same.
* testsuite/28_regex/algorithms/regex_match/extended/
string_bracket_01.cc: Same.
* testsuite/28_regex/algorithms/regex_match/extended/cstring_plus.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/extended/
string_questionmark.cc: Same.
* testsuite/28_regex/algorithms/regex_match/extended/cstring_range.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/extended/string_any.cc:
Same.
* testsuite/28_regex/algorithms/regex_match/extended/
string_dispatch_01.cc: Same.
* testsuite/28_regex/algorithms/regex_match/extended/
string_range_00_03.cc: Same.
* testsuite/28_regex/algorithms/regex_match/extended/
string_range_01_03.cc: Same.
* testsuite/28_regex/algorithms/regex_match/extended/
string_range_02_03.cc: Same.
* testsuite/28_regex/algorithms/regex_match/extended/wstring_locale.cc:
Same.
* testsuite/28_regex/algorithms/regex_search/basic/string_01.cc: Same.
* testsuite/28_regex/algorithms/regex_search/ecma/assertion.cc: Same.
* testsuite/28_regex/algorithms/regex_search/ecma/flags.cc: Same.
* testsuite/28_regex/algorithms/regex_search/ecma/greedy.cc: Same.
* testsuite/28_regex/algorithms/regex_search/ecma/string_01.cc: Same.
* testsuite/28_regex/match_results/format.cc: Same.
* testsuite/util/testsuite_regex.h
(regex_match_debug<>, regex_search_debug<>): Implement.
From-SVN: r203231
2013-10-06 17:53:14 +00:00
Oleg Endo
c3ddbdce59
re PR libstdc++/58625 (std::signbit always converts to double)
...
2013-10-06 Oleg Endo <olegendo@gcc.gnu.org>
Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/58625
* include/c_global/cmath (signbit): Use __builtin_signbitf and
__builtin_signbitl.
Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com>
From-SVN: r203228
2013-10-06 13:44:47 +00:00
Tim Shen
468146e0b5
regex_executor.tcc (_DFSExecutor<>::_M_dfs): Fix wrong backup variable initialization.
...
2013-10-03 Tim Shen <timshen91@gmail.com>
* include/bits/regex_executor.tcc (_DFSExecutor<>::_M_dfs): Fix wrong
backup variable initialization.
From-SVN: r203190
2013-10-03 20:54:01 +00:00
John Woolverton
d358f34868
re PR libstdc++/58604 (Text truncation in comments of /usr/include/c++/4.7/vector)
...
2013-10-03 John Woolverton <jdwoolverton@gmail.com>
PR libstdc++/58604
* include/std/vector: Fix garbled line in HP Copyright.
From-SVN: r203187
2013-10-03 20:33:05 +00:00
Jonathan Wakely
44d209d7e2
re PR libstdc++/58569 (Compilation error when a class contains multiple std::function)
...
2013-10-02 Jonathan Wakely <jwakely.gcc@gmail.com>
Daniel Krugler <daniel.kruegler@gmail.com>
PR libstdc++/58569
* include/std/functional (function::_CheckResult): Move to namespace
scope and rename to __check_func_return_type.
* testsuite/20_util/function/58569.cc: New.
Co-Authored-By: Daniel Kruegler <daniel.kruegler@gmail.com>
From-SVN: r203132
2013-10-02 21:21:52 +01:00
Jonathan Wakely
3fd113d7f1
re PR libstdc++/58594 (std::make_shared does not accept const types as parameters)
...
PR libstdc++/58594
* include/bits/shared_ptr_base.h
(_Sp_counted_ptr_inplace::_M_get_deleter()): Cast away cv-quals.
* testsuite/20_util/shared_ptr/creation/58594.cc: New.
From-SVN: r203131
2013-10-02 20:55:14 +01:00