Jonathan Wakely
b15062031a
PR libstdc++/81221 fix namespace qualification for parallel mode
...
PR libstdc++/81221
* include/bits/stl_algo.h (sample): Qualify with _GLIBCXX_STD_A not
std.
* testsuite/25_algorithms/sample/81221.cc: New.
From-SVN: r249698
2017-06-27 17:23:46 +01:00
Ville Voutilainen
dedf5c8523
PR libstdc++/80675, PR libstdc++/80940
...
Backport from mainline
2017-06-21 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/80675
PR libstdc++/80940
* include/std/istream:
(__is_convertible_to_basic_istream_test(basic_istream<_Ch, _Up>*)): New.
(__do_is_convertible_to_basic_istream_impl): Likewise.
(__is_convertible_to_basic_istream_impl): Likewise.
(__is_convertible_to_basic_istream): Use the new base.
(__rvalue_istream_type): New.
(operator>>(_Istream&&, _Tp&&)): Use the new helper alias
for the SFINAE check, convert to the helper alias type before
doing the actual extraction.
* include/std/ostream:
(__is_convertible_to_basic_ostream_test(basic_ostream<_Ch, _Up>*)): New.
(__do_is_convertible_to_basic_ostream_impl): Likewise.
(__is_convertible_to_basic_ostream_impl): Likewise.
(__is_convertible_to_basic_ostream): Use the new base.
(__rvalue_ostream_type): New.
(operator<<(_Ostream&&, const _Tp&)): Use the new helper alias
for the SFINAE check, convert to the helper alias type before
doing the actual insertion.
* testsuite/27_io/rvalue_streams-2.cc: Add new tests.
From-SVN: r249471
2017-06-22 00:09:46 +03:00
Uros Bizjak
50ae657ea5
baseline_symbols.txt: Update.
...
* config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.
From-SVN: r249456
2017-06-21 17:17:28 +02:00
Jonathan Wakely
08c2c9a7ab
PR libstdc++/81092 Regenerate configure for libtool_VERSION change
...
PR libstdc++/81092
* configure: Regenerate.
From-SVN: r249439
2017-06-21 09:55:52 +01:00
Rainer Orth
355a0a7911
Update Solaris baselines for GCC 7.2 (PR libstdc++/81092)
...
* config/abi/post/i386-solaris2.10/baseline_symbols.txt: Regenerate.
* config/abi/post/i386-solaris2.10/amd64/baseline_symbols.txt: Likewise.
* config/abi/post/i386-solaris2.11/baseline_symbols.txt: Likewise.
* config/abi/post/i386-solaris2.11/amd64/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris2.10/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris2.10/sparcv9/baseline_symbols.txt:
Likewise.
* config/abi/post/sparc-solaris2.11/baseline_symbols.txt: Likewise.
* config/abi/post/sparc-solaris2.11/sparcv9/baseline_symbols.txt:
Likewise.
From-SVN: r249363
2017-06-19 10:12:07 +00:00
H.J. Lu
ff14bc27a7
x32: Update baseline_symbols.txt
...
PR libstdc++/81092
* config/abi/post/x86_64-linux-gnu/x32/baseline_symbols.txt: Updated.
From-SVN: r249351
2017-06-18 12:00:49 -07:00
Jakub Jelinek
b9306aabbf
re PR libstdc++/81092 (Missing symbols for new std::wstring constructors)
...
PR libstdc++/81092
* config/abi/post/i486-linux-gnu/baseline_symbols.txt: Update.
From-SVN: r249261
2017-06-16 16:31:58 +02:00
Jonathan Wakely
d8be51c85f
Fix std::wbuffer_convert::sync()
...
* include/bits/locale_conv.h (wbuffer_convert::sync): Fix condition.
* testsuite/22_locale/conversions/buffer/2.cc: New.
From-SVN: r249256
2017-06-16 14:35:22 +01:00
Jonathan Wakely
38a5f81782
Backport libstdc++ doc improvements from mainline
...
* doc/xml/manual/appendix_contributing.xml: Link to the list of bad
names, and link to the test docs and note higher DejaGnu version
requirement.
* doc/xml/manual/allocator.xml: Fix ViewCVS URLs.
* doc/xml/manual/mt_allocator.xml: Likewise.
* doc/xml/manual/test.xml: Correct instructions on running tests.
* doc/html/*: Regenerate.
From-SVN: r249250
2017-06-16 13:19:54 +01:00
Jonathan Wakely
b1a54fbcff
PR libstdc++/81092 add std::wstring symbols and bump library version
...
PR libstdc++/81092
* acinclude.m4: Bump libtool_VERSION.
* config/abi/post/i386-linux-gnu/baseline_symbols.txt: Update.
* config/abi/post/x86_64-linux-gnu/32/baseline_symbols.txt: Update.
* config/abi/pre/gnu.ver: Add wstring constructor symbols to new
GLIBCXX_3.4.24 version.
* doc/xml/manual/abi.xml: Document new versions.
* doc/html/*: Regenerate.
* testsuite/21_strings/basic_string/cons/char/8.cc: Use base object
constructors to ensure required symbols are exported.
* testsuite/21_strings/basic_string/cons/wchar_t/8.cc: Likewise.
* testsuite/util/testsuite_abi.cc: Add new version.
From-SVN: r249248
2017-06-16 13:18:53 +01:00
Jonathan Wakely
0d6e293508
Fix missing returns in libstdc++ header and tests
...
* include/bits/locale_conv.h (wbuffer_convert::_M_put): Add missing
return statement.
* testsuite/21_strings/basic_string_view/operations/copy/char/1.cc:
Return void.
* testsuite/21_strings/basic_string_view/operations/copy/wchar_t/1.cc:
Likewise.
* testsuite/23_containers/map/modifiers/insert_or_assign/1.cc: Add
missing return statements.
* testsuite/23_containers/unordered_map/modifiers/insert_or_assign.cc:
Likewise.
* testsuite/27_io/basic_istream/extractors_arithmetic/char/12.cc:
Return void.
* testsuite/special_functions/14_expint/pr68397.cc: Likewise.
From-SVN: r249247
2017-06-16 13:18:44 +01:00
Jonathan Wakely
f7ab96ef5b
PR libstdc++/81002 fix std::basic_regex range constructor
...
PR libstdc++/81002
* include/bits/regex_compiler.h (__compile_nfa): Add template argument
list to specify traits type.
* testsuite/28_regex/basic_regex/ctors/basic/iter.cc: New.
From-SVN: r248991
2017-06-07 17:50:36 +01:00
Jonathan Wakely
ee791c3ab1
PR libstdc++/80796 Add new std::search overload for C++17
...
PR libstdc++/80796
* include/bits/stl_algo.h (search): Add new overload for C++17.
* testsuite/25_algorithms/search/searcher.cc: New.
From-SVN: r248267
2017-05-19 13:28:28 +01:00
Jonathan Wakely
3481dfbf17
PR libstdc++/80478 make std::mem_fn work with noexcept functions
...
PR libstdc++/80478
* include/std/functional (_Mem_fn_traits_base): Add specializations
for noexcept member function types.
* testsuite/20_util/function_objects/mem_fn/80478.cc: New test.
From-SVN: r248247
2017-05-18 19:04:15 +01:00
Jonathan Wakely
5862bdfc53
Fix typos in libstdc++ manual
...
* doc/xml/manual/policy_data_structures.xml: Fix typo.
* doc/xml/manual/test_policy_data_structures.xml: Likewise.
* doc/html/*: Regenerate.
From-SVN: r248190
2017-05-18 11:28:38 +01:00
Jonathan Wakely
d90d4ceea9
Update libstdc++ version info in manual
...
* doc/xml/manual/abi.xml: Document latest library versions.
* doc/xml/manual/build_hacking.xml: Document requirement to update
abi.xml when bumping library versions.
* doc/html/*: Regenerate.
From-SVN: r248187
2017-05-18 11:10:12 +01:00
Jonathan Wakely
3e6a56a27c
Fix order and types of members in C++17 insert_return_type structs
...
PR libstdc++/80761
* include/bits/node_handle.h (_Node_insert_return): Reorder members.
(tuple_size, tuple_element): Remove partial specializations.
* include/bits/stl_tree.h (_Rb_tree::insert_return_type): Use
const_iterator for std::set.
* testsuite/23_containers/map/modifiers/extract.cc: New.
* testsuite/23_containers/set/modifiers/extract.cc: New.
* testsuite/23_containers/unordered_map/modifiers/extract.cc: New.
* testsuite/23_containers/unordered_set/modifiers/extract.cc: New.
From-SVN: r248063
2017-05-15 15:01:38 +01:00
Jonathan Wakely
cf20ff6ff6
PR libstdc++/78939 make tuple_size<cv T> depend on tuple_size<T>
...
PR libstdc++/78939
* include/std/utility (tuple_size<cv T>) [__cplusplus > 201402L]:
Only define partial specializations when tuple_size<T>::value is
valid.
* testsuite/20_util/tuple/78939.cc: New.
From-SVN: r247978
2017-05-12 16:53:19 +01:00
GCC Administrator
303f81ad7e
Update ChangeLog and version files for release
...
From-SVN: r247493
2017-05-02 12:42:24 +00:00
Jonathan Wakely
db7ab54fbf
Rationalise ABI links in libstdc++ manual
...
* doc/xml/manual/abi.xml: Rephrase one of the references to the
Itanium C++ ABI.
* doc/xml/manual/test.xml: Document DejaGnu 1.5.3 requirement.
* doc/html/*: Regenerate.
From-SVN: r247003
2017-04-19 17:49:21 +01:00
Jonathan Wakely
6a8446fa8b
* libsupc++/new: Update comment on #endif directive.
...
From-SVN: r246999
2017-04-19 16:18:24 +01:00
Jonathan Wakely
6cff9199c1
PR libstdc++/80448 remove noexcept from defaulted functions
...
PR libstdc++/80448
* include/experimental/bits/fs_dir.h (directory_iterator)
(recursive_directory_iterator): Remove noexcept from defaulted
constructors.
From-SVN: r246993
2017-04-19 12:03:43 +01:00
Jonathan Wakely
afa56c1751
PR libstdc++/80446 cope with libc defining __has_builtin
...
PR libstdc++/80446
* include/std/type_traits (is_aggregate): Change __has_builtin checks.
* libsupc++/new (launder): Likewise.
From-SVN: r246992
2017-04-19 11:49:12 +01:00
Jonathan Wakely
38d68cf0f5
Fix incorrect results from std::boyer_moore_searcher
...
* include/std/functional (default_searcher, __boyer_moore_array_base)
(__is_std_equal_to, __boyer_moore_base_t, boyer_moore_searcher)
(boyer_moore_horspool_searcher): Remove redundant namespace
qualification.
(default_searcher::operator()): Construct return value early and
advance second member in-place.
(boyer_moore_horspool_searcher::operator()): Increment random access
iterator directly instead of using std::next.
(boyer_moore_searcher::operator()): Fix return value.
* testsuite/20_util/function_objects/searchers.cc: Check both parts
of return values.
From-SVN: r246964
2017-04-18 12:08:00 +01:00
Gerald Pfeifer
5ee26fce81
faq.xml: Update reference link to C++ ABI for Itanium.
...
* doc/xml/faq.xml: Update reference link to C++ ABI for Itanium.
* doc/xml/manual/abi.xml. Ditto (thrice).
From-SVN: r246860
2017-04-11 22:36:40 +00:00
Jonathan Wakely
b0dfb235e8
Remove duplicated entry in C++17 library status table
...
* doc/xml/manual/status_cxx2017.xml: Remove duplicate table entry.
* doc/html/*: Regenerate.
From-SVN: r246661
2017-04-03 19:58:32 +01:00
Jonathan Wakely
b1e282ca18
Uncomment std::reference_wrapper tests that no longer fail
...
* testsuite/20_util/reference_wrapper/invoke.cc: Uncomment tests
that no longer fail.
From-SVN: r246658
2017-04-03 18:16:11 +01:00
Jonathan Wakely
59c06f4d56
Fix comments in libstdc++ header and test
...
* include/bits/ios_base.h: Correct comment.
* testsuite/util/testsuite_hooks.h: Likewise.
From-SVN: r246657
2017-04-03 18:16:06 +01:00
Jonathan Wakely
9d83c64b16
Update C++17 library status table in manual
...
* doc/xml/manual/status_cxx2017.xml: Update C++17 status table.
* doc/xml/manual/appendix_contributing.xml (contrib.organization): Add
directories for debug, parallel and profile headers.
* doc/html/*: Regenerate.
From-SVN: r246656
2017-04-03 18:16:01 +01:00
Jonathan Wakely
8c3b5c719f
Implement P0426R1 "Constexpr for std::char_traits" for C++17 (partial)
...
* include/bits/char_traits.h (__gnu_cxx::char_traits): Add
_GLIBCXX14_CONSTEXPR on assign, compare, find, and length.
(std::char_traits<char>, std::char_traits<wchar_t>): Add
_GLIBCXX17_CONSTEXPR on assign.
(std::char_traits<char16_t>, std::char_traits<char32_t>): Add
_GLIBCXX17_CONSTEXPR on assign, compare, find, and length.
* testsuite/21_strings/char_traits/requirements/
constexpr_functions_c++17.cc: New test.
From-SVN: r246655
2017-04-03 18:15:53 +01:00
Ville Voutilainen
c1e2889a32
re PR libstdc++/79141 (std::pair<int,int> p = {}; fails to compile due to ambiguous overload)
...
PR libstdc++/79141
* include/bits/stl_pair.h (__nonesuch_no_braces): New.
(operator=(typename conditional<
__and_<is_copy_assignable<_T1>,
is_copy_assignable<_T2>>::value,
const pair&, const __nonesuch&>::type)): Change __nonesuch
to __nonesuch_no_braces.
(operator=(typename conditional<
__not_<__and_<is_copy_assignable<_T1>,
is_copy_assignable<_T2>>>::value,
const pair&, const __nonesuch&>::type)): Likewise.
(operator=(typename conditional<
__and_<is_move_assignable<_T1>,
is_move_assignable<_T2>>::value,
pair&&, __nonesuch&&>::type)): Likewise.
* testsuite/20_util/pair/79141.cc: New.
From-SVN: r246653
2017-04-03 19:30:58 +03:00
Ville Voutilainen
e2ac6765db
Implement std::is_aggregate.
...
* include/std/type_traits (is_aggregate, is_aggregate_v): New.
* testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc:
New.
* testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise.
* testsuite/20_util/is_aggregate/value.cc: Likewise.
From-SVN: r246651
2017-04-03 18:57:06 +03:00
Ville Voutilainen
0000fd8cfd
Adjust optional's pretty printer for LWG 2900.
...
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter.__init__):
Look at the nested payload in case of non-experimental optional.
From-SVN: r246566
2017-03-29 15:05:50 +03:00
Ville Voutilainen
250f5b6cc1
Implement LWG 2900, The copy and move constructors of optional are not constexpr.
...
Implement LWG 2900, The copy and move constructors
of optional are not constexpr.
* include/std/optional (_Optional_payload): New.
(_Optional_base): Remove the bool parameter.
(_Optional_base<_Tp, false>): Remove.
(_Optional_base()): Adjust.
(_Optional_base(nullopt_t)): Likewise.
(_Optional_base(in_place_t, _Args&&...)): Likewise.
(_Optional_base(in_place_t, initializer_list<_Up>, _Args&&...)):
Likewise.
(_Optional_base(const _Optional_base&)): Likewise.
(_Optional_base(_Optional_base&&)): Likewise.
(operator=(const _Optional_base&)): Likewise.
(operator=(_Optional_base&&)): Likewise.
(~_Optional_base()): Remove.
(_M_is_engaged()): Adjust.
(_M_get()): Likewise.
(_M_construct(_Args&&...)): Likewise.
(_M_destruct()): Likewise.
(_M_reset()): Likewise.
(_Optional_base::_Empty_byte): Remove.
(_Optional_base::_M_empty): Remove.
(_Optional_base::_M_payload): Adjust.
* testsuite/20_util/optional/cons/value_neg.cc: Adjust.
* testsuite/20_util/optional/constexpr/cons/value.cc: Add tests.
From-SVN: r246556
2017-03-29 02:05:21 +03:00
Jonathan Wakely
92d85953a5
PR libstdc++/80137 use std::nextafter instead of looping
...
PR libstdc++/80137
* include/bits/random.tcc (generate_canonical): Use std::nextafter
or numeric_limits::epsilon() to reduce out-of-range values.
* testsuite/26_numerics/random/uniform_real_distribution/operators/
64351.cc: Verify complexity requirement is met.
From-SVN: r246542
2017-03-28 17:09:49 +01:00
Jonathan Wakely
a138d52a9b
Add _GLIBCXX_RELEASE macro to "Using" section of manual
...
* doc/xml/manual/abi.xml: Add xml:id anchor.
* doc/xml/manual/using.xml (manual.intro.using.macros): Document
_GLIBCXX_RELEASE. Link to new anchor for __GLIBCXX__ notes.
(concurrency.io.structure): Add markup.
* doc/html/*: Regenerate.
From-SVN: r246532
2017-03-28 13:43:06 +01:00
Jonathan Wakely
b1bd915843
PR libstdc++/80229 restore support for shared_ptr<function type>
...
PR libstdc++/80229
* include/bits/shared_ptr_base.h
(__shared_ptr::_M_enable_shared_from_this_with): Change parameters to
non-const and then use remove_cv to get unqualified type.
* testsuite/20_util/enable_shared_from_this/members/const.cc: Don't
cast away constness on object created const.
* testsuite/20_util/shared_ptr/cons/80229.cc: New test.
From-SVN: r246520
2017-03-28 08:35:04 +01:00
Markus Trippelsdorf
4f28d159c5
Fix PR80183 : _M_color not moved
...
PR libstdc++/80183
* include/bits/stl_tree.h:
(_Rb_tree_header::_M_move_data(_Rb_tree_header&)): Also save _M_color.
From-SVN: r246483
2017-03-26 12:33:35 +00:00
Jonathan Wakely
01e3c2296a
Fix Debug Mode test failures
...
* testsuite/23_containers/array/tuple_interface/
tuple_element_debug_neg.cc: Adjust dg-error.
* testsuite/23_containers/list/operations/78389.cc: Fix less-than to
define a valid strict weak ordering.
* testsuite/23_containers/priority_queue/67085.cc: Disable test for
Debug Mode, due to debug checks making extra copies of predicate.
* testsuite/ext/pb_ds/regression/priority_queue_binary_heap-62045.cc:
Likewise.
From-SVN: r246426
2017-03-23 19:40:41 +00:00
Jonathan Wakely
393ed575c4
Fix broken links in manual and remove outdated info
...
* doc/xml/faq.xml: Add link.
* doc/xml/manual/backwards_compatibility.xml: Remove outdated
information on pre-ISO headers. Replace broken link to C++ FAQ Lite.
* doc/xml/manual/io.xml: Update broken link.
* doc/html/*: Regenerate.
From-SVN: r246425
2017-03-23 19:40:21 +00:00
Daniel Kruegler
7f359d19d0
Implement LWG 2686, std::hash<error_condition>, for C++17
...
2017-03-23 Daniel Kruegler <daniel.kruegler@gmail.com>
Implement LWG 2686, Why is std::hash specialized for error_code,
but not error_condition?
* include/std/system_error (hash<error_condition>): Define for C++17.
* testsuite/20_util/hash/operators/size_t.cc (hash<error_condition>):
Instantiate test for error_condition.
* testsuite/20_util/hash/requirements/explicit_instantiation.cc
(hash<error_condition>): Instantiate hash<error_condition>.
From-SVN: r246424
2017-03-23 19:40:16 +00:00
Daniel Kruegler
288695f7a4
Implement P0607R0 "Inline Variables for Standard Library" for C++17
...
2017-03-23 Daniel Kruegler <daniel.kruegler@gmail.com>
* include/bits/c++config (_GLIBCXX17_INLINE): Define.
* include/bits/regex_constants.h (All std::regex_constants constants):
Add _GLIBCXX17_INLINE as per P0607R0.
* include/bits/std_mutex.h (defer_lock, try_to_lock, adopt_lock):
Likewise.
* include/bits/stl_pair.h (piecewise_construct): Likewise.
* include/bits/uses_allocator.h (allocator_arg, uses_allocator_v)
(__is_uses_allocator_constructible_v)
(__is_nothrow_uses_allocator_constructible_v): Likewise.
* include/std/chrono (treat_as_floating_point_v): Likewise.
* include/std/functional (is_bind_expression_v, is_placeholder_v):
Likewise.
* include/std/optional (nullopt): Likewise.
* include/std/ratio (ratio_equal_v, ratio_not_equal_v, ratio_less_v)
ratio_less_equal_v, ratio_greater_v, ratio_greater_equal_v): Likewise.
* include/std/system_error (is_error_code_enum_v)
(is_error_condition_enum_v): Likewise.
* include/std/tuple (tuple_size_v, ignore): Likewise.
(ignore): Declare ignore constexpr as per LWG 2773, declare assignment
constexpr as per LWG 2933.
* include/std/type_traits (All variable templates): Add
_GLIBCXX17_INLINE as per P0607R0.
* include/std/variant (variant_size_v, variant_npos, __index_of_v)
(__tuple_count_v, __exactly_once): Likewise.
* testsuite/18_support/headers/new/synopsis.cc
(hardware_destructive_interference_size)
(hardware_constructive_interference_size): Likewise for commented-out
variables.
* testsuite/20_util/tuple/creation_functions/constexpr.cc: Add new
test function for constexpr std::ignore (LWG 2773).
* testsuite/20_util/tuple/creation_functions/constexpr_cpp14.cc: New
test for LWG 2933.
From-SVN: r246423
2017-03-23 19:40:07 +00:00
Jonathan Wakely
af181c91a9
Add deduction guides for C++17 (P0433R2, partial)
...
* include/bits/shared_ptr.h (shared_ptr, weak_ptr): Add deduction
guides for C++17.
* include/bits/std_function.h (function): Likewise.
* include/bits/stl_pair.h (pair): Likewise.
* include/debug/array (__gnu_debug::array): Likewise.
* include/std/array (array): Likewise.
* include/std/functional (make_default_searcher)
(make_boyer_moore_searcher, make_boyer_moore_horspool_searcher):
Remove generator functions.
* include/std/tuple (tuple): Add deduction guides.
* include/std/valarray (valarray): Likewise.
* testsuite/20_util/function_objects/searchers.cc: Adjust to use
class template argument deduction instead of generator functions.
* testsuite/20_util/function/cons/deduction.cc: New test.
* testsuite/20_util/optional/cons/deduction_guide.cc: Rename to ...
* testsuite/20_util/optional/cons/deduction.cc: ... here.
* testsuite/20_util/pair/cons/deduction.cc: New test.
* testsuite/20_util/shared_ptr/cons/deduction.cc: New test.
* testsuite/20_util/tuple/cons/deduction.cc: New test.
* testsuite/20_util/tuple/element_access/get_neg.cc: Adjust dg-error.
* testsuite/20_util/unique_ptr/cons/deduction_neg.cc: New test.
* testsuite/20_util/weak_ptr/cons/deduction.cc: New test.
* testsuite/23_containers/array/cons/deduction.cc: New test.
* testsuite/23_containers/array/cons/deduction_neg.cc: New test.
* testsuite/23_containers/array/tuple_interface/get_debug_neg.cc:
Adjust dg-error.
* testsuite/23_containers/array/tuple_interface/get_neg.cc: Likewise.
* testsuite/23_containers/array/tuple_interface/tuple_element_neg.cc:
Likewise.
* testsuite/26_numerics/valarray/deduction.cc: New test.
* testsuite/30_threads/lock_guard/cons/deduction.cc: New test.
* testsuite/30_threads/scoped_lock/cons/deduction.cc: New test.
* testsuite/30_threads/unique_lock/cons/deduction.cc: New test.
From-SVN: r246389
2017-03-22 15:58:35 +00:00
François Dumont
fe62dd045e
stl_deque.h (deque): Access allocator value_type only if concept checks are enabled.
...
2017-03-20 François Dumont <fdumont@gcc.gnu.org>
* include/bits/stl_deque.h (deque): Access allocator value_type only if
concept checks are enabled.
* include/bits/stl_stack.h (stack): Likewise.
* include/bits/stl_vector.h (vector): Likewise.
* include/bits/stl_list.h (list): Likewise and check
_SGIAssignableConcept only in C++03.
* include/bits/stl_map.h (map): Likewise.
* include/bits/stl_set.h (set): Likewise.
* include/bits/stl_multimap.h (multimap): Likewise.
* include/bits/stl_multiset.h (multiset): Likewise.
* include/bits/stl_queue.h (queue, priority_queue): Likewise.
From-SVN: r246294
2017-03-20 20:51:40 +00:00
Gerald Pfeifer
e76659d189
appendix_contributing.xml: Convert link to ansi.org to https.
...
* doc/xml/manual/appendix_contributing.xml: Convert link to
ansi.org to https.
Update link to the C++ standard at ansi.org.
* doc/xml/faq.xml: Remove information redundant with the above;
instead add a reference.
From-SVN: r246259
2017-03-18 18:39:54 +00:00
Jonathan Wakely
d951e75dfe
Fix alignment bugs in std::codecvt_utf16
...
* src/c++11/codecvt.cc (range): Add non-type template parameter and
define oerloaded operators for reading and writing code units.
(range<Elem, false>): Define partial specialization for accessing
wide characters in potentially unaligned byte ranges.
(ucs2_span(const char16_t*, const char16_t*, ...))
(ucs4_span(const char16_t*, const char16_t*, ...)): Change parameters
to range<const char16_t, false> in order to avoid unaligned reads.
(__codecvt_utf16_base<char16_t>::do_out)
(__codecvt_utf16_base<char32_t>::do_out)
(__codecvt_utf16_base<wchar_t>::do_out): Use range specialization for
unaligned data to avoid unaligned writes.
(__codecvt_utf16_base<char16_t>::do_in)
(__codecvt_utf16_base<char32_t>::do_in)
(__codecvt_utf16_base<wchar_t>::do_in): Likewise for writes. Return
error if there are unprocessable trailing bytes.
(__codecvt_utf16_base<char16_t>::do_length)
(__codecvt_utf16_base<char32_t>::do_length)
(__codecvt_utf16_base<wchar_t>::do_length): Pass arguments of type
range<const char16_t, false> to span functions.
* testsuite/22_locale/codecvt/codecvt_utf16/misaligned.cc: New test.
From-SVN: r246245
2017-03-17 19:28:05 +00:00
Jonathan Wakely
e363c939cb
PR libstdc++/79980 fix target type of cast
...
PR libstdc++/79980
* src/c++11/codecvt.cc (to_integer(codecvt_mode)): Fix target type.
From-SVN: r246205
2017-03-16 17:22:47 +00:00
Jonathan Wakely
a4c687d64b
PR libstdc++/80041 fix codecvt_utf16<wchar_t> to use UTF-16 not UTF-8
...
PR libstdc++/80041
* src/c++11/codecvt.cc (__codecvt_utf16_base<wchar_t>::do_out)
(__codecvt_utf16_base<wchar_t>::do_in): Convert char arguments to
char16_t to work with UTF-16 instead of UTF-8.
* testsuite/22_locale/codecvt/codecvt_utf16/80041.cc: New test.
From-SVN: r246202
2017-03-16 15:28:02 +00:00
Jonathan Wakely
516231de73
Fix encoding() and max_length() values for codecvt facets
...
* src/c++11/codecvt.cc (codecvt<char16_t, char, mbstate_t>)
(codecvt<char32_t, char, mbstate_t>, __codecvt_utf8_base<char16_t>)
(__codecvt_utf8_base<char32_t>, __codecvt_utf8_base<wchar_t>)
(__codecvt_utf16_base<char16_t>, __codecvt_utf16_base<char32_t>)
(__codecvt_utf16_base<wchar_t>, __codecvt_utf8_utf16_base<char16_t>)
(__codecvt_utf8_utf16_base<char32_t>)
(__codecvt_utf8_utf16_base<wchar_t>): Fix do_encoding() and
do_max_length() return values.
* testsuite/22_locale/codecvt/codecvt_utf16/members.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8/members.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8_utf16/members.cc: New test.
From-SVN: r246201
2017-03-16 15:27:57 +00:00
Jonathan Wakely
bcd682e1fa
PR libstdc++/79980 fix BOM detection, maxcode checks, UCS2 handling
...
PR libstdc++/79980
* include/bits/locale_conv.h (__do_str_codecvt): Set __count on
error path.
* src/c++11/codecvt.cc (operator&=, operator|=, operator~): Overloads
for manipulating codecvt_mode values.
(read_utf16_bom): Compare input to BOM constants instead of integral
constants that depend on endianness. Take mode parameter by
reference and adjust it, to distinguish between no BOM present and
UTF-16BE BOM present.
(ucs4_in, ucs2_span, ucs4_span): Adjust calls to read_utf16_bom.
(surrogates): New enumeration type.
(utf16_in, utf16_out): Add surrogates parameter to choose between
UTF-16 and UCS2 behaviour.
(utf16_span, ucs2_span): Use std::min not std::max.
(ucs2_out): Use std::min not std::max. Disallow surrogate pairs.
(ucs2_in): Likewise. Adjust calls to read_utf16_bom.
* testsuite/22_locale/codecvt/codecvt_utf16/79980.cc: New test.
* testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: New test.
From-SVN: r246200
2017-03-16 15:27:51 +00:00