summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog356
-rw-r--r--libstdc++-v3/config/allocator/malloc_allocator_base.h4
-rw-r--r--libstdc++-v3/config/allocator/new_allocator_base.h4
-rw-r--r--libstdc++-v3/config/cpu/aarch64/opt/bits/opt_random.h47
-rw-r--r--libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h180
-rw-r--r--libstdc++-v3/doc/html/faq.html144
-rw-r--r--libstdc++-v3/doc/html/manual/bugs.html282
-rw-r--r--libstdc++-v3/doc/html/manual/test.html4
-rw-r--r--libstdc++-v3/doc/xml/faq.xml146
-rw-r--r--libstdc++-v3/doc/xml/manual/intro.xml282
-rw-r--r--libstdc++-v3/doc/xml/manual/using.xml18
-rw-r--r--libstdc++-v3/include/bits/algorithmfwd.h3
-rw-r--r--libstdc++-v3/include/bits/basic_ios.h4
-rw-r--r--libstdc++-v3/include/bits/basic_string.h11
-rw-r--r--libstdc++-v3/include/bits/c++config78
-rw-r--r--libstdc++-v3/include/bits/deque.tcc2
-rw-r--r--libstdc++-v3/include/bits/forward_list.h2
-rw-r--r--libstdc++-v3/include/bits/forward_list.tcc2
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc110
-rw-r--r--libstdc++-v3/include/bits/hashtable_policy.h6
-rw-r--r--libstdc++-v3/include/bits/ios_base.h4
-rw-r--r--libstdc++-v3/include/bits/istream.tcc50
-rw-r--r--libstdc++-v3/include/bits/list.tcc2
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h4
-rw-r--r--libstdc++-v3/include/bits/locale_facets_nonio.h2
-rw-r--r--libstdc++-v3/include/bits/move.h9
-rw-r--r--libstdc++-v3/include/bits/quoted_string.h8
-rw-r--r--libstdc++-v3/include/bits/random.h9
-rw-r--r--libstdc++-v3/include/bits/random.tcc7
-rw-r--r--libstdc++-v3/include/bits/regex.h142
-rw-r--r--libstdc++-v3/include/bits/regex.tcc9
-rw-r--r--libstdc++-v3/include/bits/regex_automaton.h7
-rw-r--r--libstdc++-v3/include/bits/regex_automaton.tcc6
-rw-r--r--libstdc++-v3/include/bits/regex_compiler.h5
-rw-r--r--libstdc++-v3/include/bits/regex_compiler.tcc6
-rw-r--r--libstdc++-v3/include/bits/regex_constants.h9
-rw-r--r--libstdc++-v3/include/bits/regex_error.h7
-rw-r--r--libstdc++-v3/include/bits/regex_executor.h6
-rw-r--r--libstdc++-v3/include/bits/regex_executor.tcc6
-rw-r--r--libstdc++-v3/include/bits/regex_scanner.h6
-rw-r--r--libstdc++-v3/include/bits/regex_scanner.tcc6
-rw-r--r--libstdc++-v3/include/bits/specfun.h2
-rw-r--r--libstdc++-v3/include/bits/sstream.tcc21
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h8
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h3
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h4
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h2
-rw-r--r--libstdc++-v3/include/bits/stl_iterator.h13
-rw-r--r--libstdc++-v3/include/bits/stl_iterator_base_funcs.h4
-rw-r--r--libstdc++-v3/include/bits/stl_list.h163
-rw-r--r--libstdc++-v3/include/bits/stl_map.h4
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h4
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h4
-rw-r--r--libstdc++-v3/include/bits/stl_relops.h7
-rw-r--r--libstdc++-v3/include/bits/stl_set.h4
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h149
-rw-r--r--libstdc++-v3/include/bits/uniform_int_dist.h5
-rw-r--r--libstdc++-v3/include/bits/unordered_map.h4
-rw-r--r--libstdc++-v3/include/bits/unordered_set.h4
-rw-r--r--libstdc++-v3/include/bits/uses_allocator.h5
-rw-r--r--libstdc++-v3/include/bits/vector.tcc66
-rw-r--r--libstdc++-v3/include/c_global/cmath30
-rw-r--r--libstdc++-v3/include/c_std/cmath13
-rw-r--r--libstdc++-v3/include/decimal/decimal8
-rw-r--r--libstdc++-v3/include/decimal/decimal.h7
-rw-r--r--libstdc++-v3/include/experimental/algorithm8
-rw-r--r--libstdc++-v3/include/experimental/any7
-rw-r--r--libstdc++-v3/include/experimental/array6
-rw-r--r--libstdc++-v3/include/experimental/bits/erase_if.h6
-rw-r--r--libstdc++-v3/include/experimental/bits/fs_dir.h7
-rw-r--r--libstdc++-v3/include/experimental/bits/fs_fwd.h10
-rw-r--r--libstdc++-v3/include/experimental/bits/fs_ops.h7
-rw-r--r--libstdc++-v3/include/experimental/bits/fs_path.h6
-rw-r--r--libstdc++-v3/include/experimental/bits/lfts_config.h23
-rw-r--r--libstdc++-v3/include/experimental/bits/shared_ptr.h8
-rw-r--r--libstdc++-v3/include/experimental/bits/string_view.tcc8
-rw-r--r--libstdc++-v3/include/experimental/chrono5
-rw-r--r--libstdc++-v3/include/experimental/deque19
-rw-r--r--libstdc++-v3/include/experimental/filesystem8
-rw-r--r--libstdc++-v3/include/experimental/forward_list20
-rw-r--r--libstdc++-v3/include/experimental/functional12
-rw-r--r--libstdc++-v3/include/experimental/iterator8
-rw-r--r--libstdc++-v3/include/experimental/list12
-rw-r--r--libstdc++-v3/include/experimental/map25
-rw-r--r--libstdc++-v3/include/experimental/memory8
-rw-r--r--libstdc++-v3/include/experimental/memory_resource18
-rw-r--r--libstdc++-v3/include/experimental/numeric8
-rw-r--r--libstdc++-v3/include/experimental/optional11
-rw-r--r--libstdc++-v3/include/experimental/propagate_const7
-rw-r--r--libstdc++-v3/include/experimental/random8
-rw-r--r--libstdc++-v3/include/experimental/ratio8
-rw-r--r--libstdc++-v3/include/experimental/regex5
-rw-r--r--libstdc++-v3/include/experimental/set26
-rw-r--r--libstdc++-v3/include/experimental/source_location8
-rw-r--r--libstdc++-v3/include/experimental/string39
-rw-r--r--libstdc++-v3/include/experimental/string_view21
-rw-r--r--libstdc++-v3/include/experimental/system_error8
-rw-r--r--libstdc++-v3/include/experimental/tuple8
-rw-r--r--libstdc++-v3/include/experimental/type_traits11
-rw-r--r--libstdc++-v3/include/experimental/unordered_map28
-rw-r--r--libstdc++-v3/include/experimental/unordered_set28
-rw-r--r--libstdc++-v3/include/experimental/utility8
-rw-r--r--libstdc++-v3/include/experimental/vector20
-rw-r--r--libstdc++-v3/include/ext/bitmap_allocator.h8
-rw-r--r--libstdc++-v3/include/ext/codecvt_specializations.h4
-rw-r--r--libstdc++-v3/include/ext/random7
-rw-r--r--libstdc++-v3/include/ext/rope22
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h6
-rw-r--r--libstdc++-v3/include/ext/typelist.h21
-rw-r--r--libstdc++-v3/include/std/chrono25
-rw-r--r--libstdc++-v3/include/std/complex6
-rw-r--r--libstdc++-v3/include/std/functional6
-rw-r--r--libstdc++-v3/include/std/istream12
-rw-r--r--libstdc++-v3/include/std/mutex6
-rw-r--r--libstdc++-v3/include/std/numeric10
-rw-r--r--libstdc++-v3/include/std/sstream30
-rw-r--r--libstdc++-v3/include/std/streambuf7
-rw-r--r--libstdc++-v3/include/std/string_view11
-rw-r--r--libstdc++-v3/include/std/thread7
-rw-r--r--libstdc++-v3/include/std/variant340
-rw-r--r--libstdc++-v3/include/tr1/array6
-rw-r--r--libstdc++-v3/include/tr1/bessel_function.tcc8
-rw-r--r--libstdc++-v3/include/tr1/beta_function.tcc8
-rw-r--r--libstdc++-v3/include/tr1/cmath47
-rw-r--r--libstdc++-v3/include/tr1/complex6
-rw-r--r--libstdc++-v3/include/tr1/ell_integral.tcc8
-rw-r--r--libstdc++-v3/include/tr1/exp_integral.tcc8
-rw-r--r--libstdc++-v3/include/tr1/functional15
-rw-r--r--libstdc++-v3/include/tr1/functional_hash.h6
-rw-r--r--libstdc++-v3/include/tr1/gamma.tcc8
-rw-r--r--libstdc++-v3/include/tr1/hashtable.h6
-rw-r--r--libstdc++-v3/include/tr1/hashtable_policy.h7
-rw-r--r--libstdc++-v3/include/tr1/hypergeometric.tcc8
-rw-r--r--libstdc++-v3/include/tr1/legendre_function.tcc8
-rw-r--r--libstdc++-v3/include/tr1/modified_bessel_func.tcc8
-rw-r--r--libstdc++-v3/include/tr1/poly_hermite.tcc8
-rw-r--r--libstdc++-v3/include/tr1/poly_laguerre.tcc8
-rw-r--r--libstdc++-v3/include/tr1/random.h13
-rw-r--r--libstdc++-v3/include/tr1/random.tcc9
-rw-r--r--libstdc++-v3/include/tr1/regex9
-rw-r--r--libstdc++-v3/include/tr1/riemann_zeta.tcc8
-rw-r--r--libstdc++-v3/include/tr1/shared_ptr.h6
-rw-r--r--libstdc++-v3/include/tr1/special_function_util.h8
-rw-r--r--libstdc++-v3/include/tr1/tuple6
-rw-r--r--libstdc++-v3/include/tr1/type_traits6
-rw-r--r--libstdc++-v3/include/tr1/unordered_map.h6
-rw-r--r--libstdc++-v3/include/tr1/unordered_set.h6
-rw-r--r--libstdc++-v3/include/tr1/utility6
-rw-r--r--libstdc++-v3/include/tr2/bool_set6
-rw-r--r--libstdc++-v3/include/tr2/bool_set.tcc6
-rw-r--r--libstdc++-v3/include/tr2/dynamic_bitset6
-rw-r--r--libstdc++-v3/include/tr2/dynamic_bitset.tcc6
-rw-r--r--libstdc++-v3/include/tr2/ratio6
-rw-r--r--libstdc++-v3/include/tr2/type_traits6
-rw-r--r--libstdc++-v3/libsupc++/new2
-rw-r--r--libstdc++-v3/python/libstdcxx/v6/printers.py12
-rw-r--r--libstdc++-v3/src/c++11/chrono.cc8
-rw-r--r--libstdc++-v3/src/c++11/compatibility-c++0x.cc7
-rw-r--r--libstdc++-v3/src/c++11/compatibility-chrono.cc8
-rw-r--r--libstdc++-v3/src/c++11/cxx11-shim_facets.cc6
-rw-r--r--libstdc++-v3/src/c++11/hashtable_c++0x.cc6
-rw-r--r--libstdc++-v3/src/c++11/placeholders.cc6
-rw-r--r--libstdc++-v3/src/c++11/thread.cc7
-rw-r--r--libstdc++-v3/src/c++98/bitmap_allocator.cc6
-rw-r--r--libstdc++-v3/src/c++98/hashtable_tr1.cc4
-rw-r--r--libstdc++-v3/src/c++98/list.cc8
-rw-r--r--libstdc++-v3/src/shared/hashtable-aux.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/literals/range.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/forward/c_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/forward/f_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc6
-rw-r--r--libstdc++-v3/testsuite/20_util/variant/compile.cc103
-rw-r--r--libstdc++-v3/testsuite/20_util/variant/deduction.cc39
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/5.cc55
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/allocator/default_init.cc71
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/sample/81221.cc22
-rw-r--r--libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc8
-rw-r--r--libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc8
-rw-r--r--libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/81395.cc46
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc39
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/53984.cc41
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/81381.cc42
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_stringstream/assign/81338.cc40
-rw-r--r--libstdc++-v3/testsuite/27_io/types/1.cc8
-rw-r--r--libstdc++-v3/testsuite/27_io/types/4.cc29
-rw-r--r--libstdc++-v3/testsuite/30_threads/scoped_lock/cons/1.cc4
-rw-r--r--libstdc++-v3/testsuite/30_threads/scoped_lock/cons/deduction.cc25
-rw-r--r--libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc6
-rw-r--r--libstdc++-v3/testsuite/abi/pr42230.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/23_containers/insert/81476.cc86
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_abi.cc15
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_abi.h2
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_hooks.cc8
-rw-r--r--libstdc++-v3/testsuite/util/testsuite_iterators.h12
198 files changed, 2997 insertions, 1650 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 6be91fedcc5..c723b94875b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,359 @@
+2017-07-26 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/27_io/basic_fstream/53984.cc: Fix test.
+
+2017-07-26 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * testsuite/27_io/basic_fstream/53984.cc: Fix typo in dg-require
+ directive.
+
+2017-07-25 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/53984
+ * include/bits/basic_ios.h (basic_ios::_M_setstate): Adjust comment.
+ * include/bits/istream.tcc (basic_istream::sentry): Handle exceptions
+ during construction.
+ * include/std/istream: Adjust comments for formatted input functions
+ and unformatted input functions.
+ * testsuite/27_io/basic_fstream/53984.cc: New.
+ * testsuite/27_io/basic_istream/sentry/char/53984.cc: New.
+
+ * include/bits/ios_base.h (ios_base::io_state, ios_base::open_mode)
+ (ios_base::seek_dir): Remove for C++17.
+ * include/std/streambuf (basic_streambuf::stossc): Remove for C++17.
+ Add deprecated attribute for C++11 and C++14.
+ * testsuite/27_io/types/1.cc: Don't run for C++17 and later.
+ * testsuite/27_io/types/4.cc: New.
+
+2017-07-23 Michael Collison <michael.collison@arm.com>
+
+ Add optimized implementation of mersenne twister for aarch64
+ * config/cpu/aarch64/opt/ext/opt_random.h: New file.
+ (__arch64_recursion): New function.
+ (__aarch64_lsr_128): New function.
+ (__aarch64_lsl_128): New function.
+ (operator==): New function.
+ (simd_fast_mersenne_twister_engine): Implement
+ method _M_gen_rand.
+ * config/cpu/aarch64/opt/bits/opt_random.h: New file.
+ * include/ext/random: (simd_fast_mersenne_twister_engine):
+ add _M_state private array.
+
+2017-07-23 François Dumont <fdumont@gcc.gnu.org>
+
+ PR libstdc++/81064
+ * include/bits/algorithmfwd.h: Reorganize versioned namespace.
+ * include/bits/basic_string.h: Likewise.
+ * include/bits/c++config: Likewise.
+ * include/bits/deque.tcc: Likewise.
+ * include/bits/forward_list.h: Likewise.
+ * include/bits/forward_list.tcc: Likewise.
+ * include/bits/hashtable_policy.h: Likewise.
+ * include/bits/list.tcc: Likewise.
+ * include/bits/move.h: Likewise.
+ * include/bits/quoted_string.h: Likewise.
+ * include/bits/random.h: Likewise.
+ * include/bits/random.tcc: Likewise.
+ * include/bits/regex.h: Likewise.
+ * include/bits/regex.tcc: Likewise.
+ * include/bits/regex_automaton.h: Likewise.
+ * include/bits/regex_automaton.tcc: Likewise.
+ * include/bits/regex_compiler.h: Likewise.
+ * include/bits/regex_compiler.tcc: Likewise.
+ * include/bits/regex_constants.h: Likewise.
+ * include/bits/regex_error.h: Likewise.
+ * include/bits/regex_executor.h: Likewise.
+ * include/bits/regex_executor.tcc: Likewise.
+ * include/bits/regex_scanner.h: Likewise.
+ * include/bits/regex_scanner.tcc: Likewise.
+ * include/bits/specfun.h: Likewise.
+ * include/bits/stl_algo.h: Likewise.
+ * include/bits/stl_algobase.h: Likewise.
+ * include/bits/stl_bvector.h: Likewise.
+ * include/bits/stl_deque.h: Likewise.
+ * include/bits/stl_iterator.h: Likewise.
+ * include/bits/stl_iterator_base_funcs.h: Likewise.
+ * include/bits/stl_list.h: Likewise.
+ * include/bits/stl_map.h: Likewise.
+ * include/bits/stl_multimap.h: Likewise.
+ * include/bits/stl_multiset.h: Likewise.
+ * include/bits/stl_relops.h: Likewise.
+ * include/bits/stl_set.h: Likewise.
+ * include/bits/stl_vector.h: Likewise.
+ * include/bits/uniform_int_dist.h: Likewise.
+ * include/bits/unordered_map.h: Likewise.
+ * include/bits/unordered_set.h: Likewise.
+ * include/bits/vector.tcc: Likewise.
+ * include/c_global/cmath: Likewise.
+ * include/c_std/cmath: Likewise.
+ * include/decimal/decimal: Likewise.
+ * include/decimal/decimal.h: Likewise.
+ * include/experimental/algorithm: Likewise.
+ * include/experimental/any: Likewise.
+ * include/experimental/array: Likewise.
+ * include/experimental/bits/erase_if.h: Likewise.
+ * include/experimental/bits/fs_dir.h: Likewise.
+ * include/experimental/bits/fs_fwd.h: Likewise.
+ * include/experimental/bits/fs_ops.h: Likewise.
+ * include/experimental/bits/fs_path.h: Likewise.
+ * include/experimental/bits/lfts_config.h: Likewise.
+ * include/experimental/bits/shared_ptr.h: Likewise.
+ * include/experimental/bits/string_view.tcc: Likewise.
+ * include/experimental/chrono: Likewise.
+ * include/experimental/deque: Likewise.
+ * include/experimental/filesystem: Likewise.
+ * include/experimental/forward_list: Likewise.
+ * include/experimental/functional: Likewise.
+ * include/experimental/iterator: Likewise.
+ * include/experimental/list: Likewise.
+ * include/experimental/map: Likewise.
+ * include/experimental/memory: Likewise.
+ * include/experimental/memory_resource: Likewise.
+ * include/experimental/numeric: Likewise.
+ * include/experimental/optional: Likewise.
+ * include/experimental/propagate_const: Likewise.
+ * include/experimental/random: Likewise.
+ * include/experimental/ratio: Likewise.
+ * include/experimental/regex: Likewise.
+ * include/experimental/set: Likewise.
+ * include/experimental/source_location: Likewise.
+ * include/experimental/string: Likewise.
+ * include/experimental/string_view: Likewise.
+ * include/experimental/system_error: Likewise.
+ * include/experimental/tuple: Likewise.
+ * include/experimental/type_traits: Likewise.
+ * include/experimental/unordered_map: Likewise.
+ * include/experimental/unordered_set: Likewise.
+ * include/experimental/utility: Likewise.
+ * include/experimental/vector: Likewise.
+ * include/ext/bitmap_allocator.h: Likewise.
+ * include/ext/codecvt_specializations.h: Likewise.
+ * include/ext/rope: Likewise.
+ * include/ext/typelist.h: Likewise.
+ * include/std/chrono: Likewise.
+ * include/std/complex: Likewise.
+ * include/std/functional: Likewise.
+ * include/std/numeric: Likewise.
+ * include/std/string_view: Likewise.
+ * include/std/thread: Likewise.
+ * include/std/variant: Likewise.
+ * include/tr1/array: Likewise.
+ * include/tr1/bessel_function.tcc: Likewise.
+ * include/tr1/beta_function.tcc: Likewise.
+ * include/tr1/cmath: Likewise.
+ * include/tr1/complex: Likewise.
+ * include/tr1/ell_integral.tcc: Likewise.
+ * include/tr1/exp_integral.tcc: Likewise.
+ * include/tr1/functional: Likewise.
+ * include/tr1/functional_hash.h: Likewise.
+ * include/tr1/gamma.tcc: Likewise.
+ * include/tr1/hashtable.h: Likewise.
+ * include/tr1/hashtable_policy.h: Likewise.
+ * include/tr1/hypergeometric.tcc: Likewise.
+ * include/tr1/legendre_function.tcc: Likewise.
+ * include/tr1/modified_bessel_func.tcc: Likewise.
+ * include/tr1/poly_hermite.tcc: Likewise.
+ * include/tr1/poly_laguerre.tcc: Likewise.
+ * include/tr1/random.h: Likewise.
+ * include/tr1/random.tcc: Likewise.
+ * include/tr1/regex: Likewise.
+ * include/tr1/riemann_zeta.tcc: Likewise.
+ * include/tr1/shared_ptr.h: Likewise.
+ * include/tr1/special_function_util.h: Likewise.
+ * include/tr1/tuple: Likewise.
+ * include/tr1/type_traits: Likewise.
+ * include/tr1/unordered_map.h: Likewise.
+ * include/tr1/unordered_set.h: Likewise.
+ * include/tr1/utility: Likewise.
+ * include/tr2/bool_set: Likewise.
+ * include/tr2/bool_set.tcc: Likewise.
+ * include/tr2/dynamic_bitset: Likewise.
+ * include/tr2/dynamic_bitset.tcc: Likewise.
+ * include/tr2/ratio: Likewise.
+ * include/tr2/type_traits: Likewise.
+ * src/c++11/chrono.cc: Likewise.
+ * src/c++11/compatibility-c++0x.cc: Likewise.
+ * src/c++11/compatibility-chrono.cc: Likewise.
+ * src/c++11/cxx11-shim_facets.cc: Likewise.
+ * src/c++11/hashtable_c++0x.cc: Likewise.
+ * src/c++11/placeholders.cc: Likewise.
+ * src/c++11/thread.cc: Likewise.
+ * src/c++98/bitmap_allocator.cc: Likewise.
+ * src/c++98/hashtable_tr1.cc: Likewise.
+ * src/c++98/list.cc: Likewise.
+ * src/shared/hashtable-aux.cc: Likewise.
+ * testsuite/20_util/duration/literals/range.cc: Adapt line number.
+ * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
+ * testsuite/20_util/forward/c_neg.cc: Likewise.
+ * testsuite/20_util/forward/f_neg.cc: Likewise.
+ * testsuite/26_numerics/gcd/gcd_neg.cc: Likewise.
+ * testsuite/26_numerics/lcm/lcm_neg.cc: Likewise.
+ * testsuite/26_numerics/random/pr60037-neg.cc: Likewise.
+ * python/libstdcxx/v6/printers.py: Adapt.
+
+2017-07-20 Jonathan Wakely <jwakely@redhat.com>
+
+ * config/allocator/malloc_allocator_base.h [__SANITIZE_ADDRESS__]
+ (_GLIBCXX_SANITIZE_STD_ALLOCATOR): Define.
+ * config/allocator/new_allocator_base.h [__SANITIZE_ADDRESS__]
+ (_GLIBCXX_SANITIZE_STD_ALLOCATOR): Define.
+ * doc/xml/manual/using.xml (_GLIBCXX_SANITIZE_VECTOR): Document macro.
+ * include/bits/stl_vector.h [_GLIBCXX_SANITIZE_VECTOR]
+ (_Vector_impl::_Asan, _Vector_impl::_Asan::_Reinit)
+ (_Vector_impl::_Asan::_Grow, _GLIBCXX_ASAN_ANNOTATE_REINIT)
+ (_GLIBCXX_ASAN_ANNOTATE_GROW, _GLIBCXX_ASAN_ANNOTATE_GREW)
+ (_GLIBCXX_ASAN_ANNOTATE_SHRINK, _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC):
+ Define annotation helper types and macros.
+ (vector::~vector, vector::push_back, vector::pop_back)
+ (vector::_M_erase_at_end): Add annotations.
+ * include/bits/vector.tcc (vector::reserve, vector::emplace_back)
+ (vector::insert, vector::_M_erase, vector::operator=)
+ (vector::_M_fill_assign, vector::_M_assign_aux)
+ (vector::_M_insert_rval, vector::_M_emplace_aux)
+ (vector::_M_insert_aux, vector::_M_realloc_insert)
+ (vector::_M_fill_insert, vector::_M_default_append)
+ (vector::_M_shrink_to_fit, vector::_M_range_insert): Annotate.
+
+2017-07-19 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/81476
+ * include/bits/vector.tcc (vector::_M_range_insert<_InputIterator>):
+ Only insert elements one-by-one when inserting at the end.
+ * testsuite/performance/23_containers/insert/81476.cc: New.
+
+2017-07-19 Volker Reichelt <v.reichelt@netcologne.de>
+
+ * libsupc++/new (bad_array_new_length): Remove redundant
+ semicolon after in-class member function definition.
+ * include/bits/locale_facets.h (ctype_byname, num_put): Likewise.
+ * include/bits/locale_facets_nonio.h (time_put_byname): Likewise.
+ * include/bits/random.h (mersenne_twister_engine): Likewise.
+ * include/tr1/random.h (mersenne_twister): Likewise
+ * include/ext/random (simd_fast_mersenne_twister_engine): Likewise.
+ * include/ext/rope (char_producer, _Rope_char_consumer,
+ _Rope_self_destruct_ptr, _Rope_const_iterator, _Rope_iterator):
+ Likewise.
+ * include/ext/ropeimpl.h (_Rope_flatten_char_consumer,
+ _Rope_insert_char_consumer): Likewise.
+
+2017-07-19 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/fstream.tcc (basic_filebuf::xsgetn)
+ (basic_filebuf::xsputn, basic_filebuf::seekoff): Fix indentation.
+
+ * testsuite/util/testsuite_iterators.h: Fix indentation.
+
+ * testsuite/27_io/basic_filebuf/sgetn/char/81395.cc: Add dg-require.
+
+2017-07-18 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/81395
+ * include/bits/fstream.tcc (basic_filebuf::xsgetn): Don't set buffer
+ pointers for write mode after reading.
+ * testsuite/27_io/basic_filebuf/sgetn/char/81395.cc: New.
+
+2017-07-18 François Dumont <fdumont@gcc.gnu.org>
+
+ * include/bits/stl_list.h
+ (struct _List_node_header): New.
+ (_List_impl()): Fix noexcept qualification.
+ (_List_impl(_List_impl&&)): New, default.
+ (_List_base()): Default.
+ (_List_base(_List_base&&)): Default.
+ (_List_base::_M_move_nodes): Adapt to use
+ _List_node_header._M_move_nodes.
+ (_List_base::_M_init): Likewise.
+ (list<>()): Default.
+ (list<>(list&&)): Default.
+ (list<>::_M_move_assign(list&&, true_type)): Use _M_move_nodes.
+ (__distance(_List_const_iterator<>, _List_const_iterator<>,
+ input_iterator_tag)): Adapt.
+ * testsuite/23_containers/list/allocator/default_init.cc: New.
+
+2017-07-15 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/mutex (scoped_lock): Reorder std::adopt_lock_t parameter
+ as per P0739R0.
+ * testsuite/30_threads/scoped_lock/cons/1.cc: Reorder arguments.
+ * testsuite/30_threads/scoped_lock/cons/deduction.cc: Test deduction
+ with std::adopt_lock_t.
+ * testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Check
+ feature-test macro.
+
+2017-07-14 Jason Merrill <jason@redhat.com>
+ Jonathan Wakely <jwakely@redhat.com>
+
+ * include/std/variant (variant::variant(_Tp&&)): Constrain to remove
+ the constructor for empty variants from the candidate functions
+ during class template argument deduction.
+ * testsuite/20_util/variant/deduction.cc: New.
+
+2017-07-11 Jonathan Wakely <jwakely@redhat.com>
+
+ * doc/xml/faq.xml: Update several old entries. Improve
+ cross-references.
+ * doc/xml/manual/intro.xml: Add anchors to each DR.
+ * doc/html/*: Regenerate.
+
+2017-07-10 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/abi/pr42230.cc: Add header for std::free.
+
+ PR libstdc++/81381
+ * include/bits/sstream.tcc (basic_stringbuf::overflow)
+ (basic_stringbuf::basic_stringbuf(const __string_type&, ios::mode))
+ (basic_stringbuf::str()): Construct new strings with an allocator.
+ * testsuite/27_io/basic_stringbuf/cons/81381.cc: New.
+
+ PR libstdc++/81338
+ * include/bits/basic_string.h [_GLIBCXX_USE_CXX11_ABI] (basic_string):
+ Declare basic_stringbuf to be a friend.
+ * include/bits/sstream.tcc (basic_stringbuf::overflow)
+ [_GLIBCXX_USE_CXX11_ABI]: Use unused capacity before reallocating.
+ * include/std/sstream (basic_stringbuf::__xfer_bufptrs): Update string
+ length to buffer length.
+ * testsuite/27_io/basic_stringstream/assign/81338.cc: New.
+
+2017-07-06 Jonathan Wakely <jwakely@redhat.com>
+
+ * testsuite/20_util/specialized_algorithms/memory_management_tools/
+ 1.cc: Free memory.
+ * testsuite/22_locale/locale/cons/5.cc: Remove redundant restoration
+ of original environment and free memory.
+
+ * testsuite/abi/pr42230.cc: Free memory.
+ * testsuite/util/testsuite_abi.cc (demangle): Return std::string
+ instead of pointer that might need freeing.
+ * testsuite/util/testsuite_abi.h (demangle): Likewise.
+ * testsuite/util/testsuite_hooks.cc (verify_demangle): Free memory.
+
+ * include/bits/uses_allocator.h (__use_alloc(const _Alloc&&)): Add
+ deleted overload to prevent dangling references to rvalues.
+ * include/experimental/memory_resource
+ (polymorphic_allocator::construct): Do not call __use_alloc with
+ rvalue arguments.
+
+2017-06-27 Tim Shen <timshen@google.com>
+
+ PR libstdc++/80187
+ * include/std/variant (variant::variant, variant::~variant,
+ variant::operator=): Implement triviality forwarding for four
+ special member functions.
+ * testsuite/20_util/variant/compile.cc: Tests.
+
+2017-06-27 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/81221
+ * testsuite/25_algorithms/sample/81221.cc: Disable except for
+ check-parallel.
+
+ PR libstdc++/81221
+ * include/bits/stl_algo.h (sample): Qualify with _GLIBCXX_STD_A not
+ std.
+ * testsuite/25_algorithms/sample/81221.cc: New.
+
2017-06-22 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/81173
diff --git a/libstdc++-v3/config/allocator/malloc_allocator_base.h b/libstdc++-v3/config/allocator/malloc_allocator_base.h
index b091bbca863..54e0837f01f 100644
--- a/libstdc++-v3/config/allocator/malloc_allocator_base.h
+++ b/libstdc++-v3/config/allocator/malloc_allocator_base.h
@@ -52,4 +52,8 @@ namespace std
# define __allocator_base __gnu_cxx::malloc_allocator
#endif
+#if defined(__SANITIZE_ADDRESS__) && !defined(_GLIBCXX_SANITIZE_STD_ALLOCATOR)
+# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
+#endif
+
#endif
diff --git a/libstdc++-v3/config/allocator/new_allocator_base.h b/libstdc++-v3/config/allocator/new_allocator_base.h
index 3d2bb67887f..e776ed31864 100644
--- a/libstdc++-v3/config/allocator/new_allocator_base.h
+++ b/libstdc++-v3/config/allocator/new_allocator_base.h
@@ -52,4 +52,8 @@ namespace std
# define __allocator_base __gnu_cxx::new_allocator
#endif
+#if defined(__SANITIZE_ADDRESS__) && !defined(_GLIBCXX_SANITIZE_STD_ALLOCATOR)
+# define _GLIBCXX_SANITIZE_STD_ALLOCATOR 1
+#endif
+
#endif
diff --git a/libstdc++-v3/config/cpu/aarch64/opt/bits/opt_random.h b/libstdc++-v3/config/cpu/aarch64/opt/bits/opt_random.h
new file mode 100644
index 00000000000..fba7ea812ad
--- /dev/null
+++ b/libstdc++-v3/config/cpu/aarch64/opt/bits/opt_random.h
@@ -0,0 +1,47 @@
+// Optimizations for random number functions, aarch64 version -*- C++ -*-
+
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file bits/opt_random.h
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{random}
+ */
+
+#ifndef _BITS_OPT_RANDOM_H
+#define _BITS_OPT_RANDOM_H 1
+
+#pragma GCC system_header
+
+
+namespace std _GLIBCXX_VISIBILITY (default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+
+
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
+
+#endif // _BITS_OPT_RANDOM_H
diff --git a/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h b/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h
new file mode 100644
index 00000000000..330050fc7f7
--- /dev/null
+++ b/libstdc++-v3/config/cpu/aarch64/opt/ext/opt_random.h
@@ -0,0 +1,180 @@
+// Optimizations for random number extensions, aarch64 version -*- C++ -*-
+
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ext/random.tcc
+ * This is an internal header file, included by other library headers.
+ * Do not attempt to use it directly. @headername{ext/random}
+ */
+
+#ifndef _EXT_OPT_RANDOM_H
+#define _EXT_OPT_RANDOM_H 1
+
+#pragma GCC system_header
+
+#ifdef __ARM_NEON
+
+#ifdef __AARCH64EB__
+# define __VEXT(_A,_B,_C) __builtin_shuffle (_A, _B, (__Uint8x16_t) \
+ {16-_C, 17-_C, 18-_C, 19-_C, 20-_C, 21-_C, 22-_C, 23-_C, \
+ 24-_C, 25-_C, 26-_C, 27-_C, 28-_C, 29-_C, 30-_C, 31-_C})
+#else
+# define __VEXT(_A,_B,_C) __builtin_shuffle (_B, _A, (__Uint8x16_t) \
+ {_C, _C+1, _C+2, _C+3, _C+4, _C+5, _C+6, _C+7, \
+ _C+8, _C+9, _C+10, _C+11, _C+12, _C+13, _C+14, _C+15})
+#endif
+
+namespace __gnu_cxx _GLIBCXX_VISIBILITY (default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ namespace {
+ // Logical Shift right 128-bits by c * 8 bits
+
+ __extension__ extern __inline __Uint32x4_t
+ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
+ __aarch64_lsr_128 (__Uint8x16_t __a, __const int __c)
+ {
+ const __Uint8x16_t __zero = {0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0};
+
+ return (__Uint32x4_t) __VEXT (__zero, __a, __c);
+ }
+
+ // Logical Shift left 128-bits by c * 8 bits
+
+ __extension__ extern __inline __Uint32x4_t
+ __attribute__ ((__always_inline__, __gnu_inline__, __artificial__))
+ __aarch64_lsl_128 (__Uint8x16_t __a, __const int __c)
+ {
+ const __Uint8x16_t __zero = {0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0};
+
+ return (__Uint32x4_t) __VEXT (__a, __zero, 16 - __c);
+ }
+
+ template<size_t __sl1, size_t __sl2, size_t __sr1, size_t __sr2>
+ inline __Uint32x4_t __aarch64_recursion (__Uint32x4_t __a,
+ __Uint32x4_t __b,
+ __Uint32x4_t __c,
+ __Uint32x4_t __d,
+ __Uint32x4_t __e)
+ {
+ __Uint32x4_t __y = (__b >> __sr1);
+ __Uint32x4_t __z = __aarch64_lsr_128 ((__Uint8x16_t) __c, __sr2);
+
+ __Uint32x4_t __v = __d << __sl1;
+
+ __z = __z ^ __a;
+ __z = __z ^ __v;
+
+ __Uint32x4_t __x = __aarch64_lsl_128 ((__Uint8x16_t) __a, __sl2);
+
+ __y = __y & __e;
+ __z = __z ^ __x;
+ return __z ^ __y;
+ }
+}
+
+#define _GLIBCXX_OPT_HAVE_RANDOM_SFMT_GEN_READ 1
+ template<typename _UIntType, size_t __m,
+ size_t __pos1, size_t __sl1, size_t __sl2,
+ size_t __sr1, size_t __sr2,
+ uint32_t __msk1, uint32_t __msk2,
+ uint32_t __msk3, uint32_t __msk4,
+ uint32_t __parity1, uint32_t __parity2,
+ uint32_t __parity3, uint32_t __parity4>
+ void simd_fast_mersenne_twister_engine<_UIntType, __m,
+ __pos1, __sl1, __sl2, __sr1, __sr2,
+ __msk1, __msk2, __msk3, __msk4,
+ __parity1, __parity2, __parity3,
+ __parity4>::
+ _M_gen_rand (void)
+ {
+ __Uint32x4_t __r1 = _M_state[_M_nstate - 2];
+ __Uint32x4_t __r2 = _M_state[_M_nstate - 1];
+
+ __Uint32x4_t __aData = {__msk1, __msk2, __msk3, __msk4};
+
+ size_t __i;
+ for (__i = 0; __i < _M_nstate - __pos1; ++__i)
+ {
+ __Uint32x4_t __r = __aarch64_recursion<__sl1, __sl2, __sr1, __sr2>
+ (_M_state[__i], _M_state[__i + __pos1], __r1, __r2, __aData);
+
+ _M_state[__i] = __r;
+
+ __r1 = __r2;
+ __r2 = __r;
+ }
+ for (; __i < _M_nstate; ++__i)
+ {
+ __Uint32x4_t __r = __aarch64_recursion<__sl1, __sl2, __sr1, __sr2>
+ (_M_state[__i], _M_state[__i + __pos1 - _M_nstate], __r1, __r2,
+ __aData);
+
+ _M_state[__i] = __r;
+
+ __r1 = __r2;
+ __r2 = __r;
+ }
+
+ _M_pos = 0;
+ }
+
+
+#define _GLIBCXX_OPT_HAVE_RANDOM_SFMT_OPERATOREQUAL 1
+ template<typename _UIntType, size_t __m,
+ size_t __pos1, size_t __sl1, size_t __sl2,
+ size_t __sr1, size_t __sr2,
+ uint32_t __msk1, uint32_t __msk2,
+ uint32_t __msk3, uint32_t __msk4,
+ uint32_t __parity1, uint32_t __parity2,
+ uint32_t __parity3, uint32_t __parity4>
+ bool
+ operator==(const __gnu_cxx::simd_fast_mersenne_twister_engine<_UIntType,
+ __m, __pos1, __sl1, __sl2, __sr1, __sr2,
+ __msk1, __msk2, __msk3, __msk4,
+ __parity1, __parity2, __parity3, __parity4>& __lhs,
+ const __gnu_cxx::simd_fast_mersenne_twister_engine<_UIntType,
+ __m, __pos1, __sl1, __sl2, __sr1, __sr2,
+ __msk1, __msk2, __msk3, __msk4,
+ __parity1, __parity2, __parity3, __parity4>& __rhs)
+ {
+ if (__lhs._M_pos != __rhs._M_pos)
+ return false;
+
+ __Uint32x4_t __res = __lhs._M_state[0] ^ __rhs._M_state[0];
+
+ for (size_t __i = 1; __i < __lhs._M_nstate; ++__i)
+ __res |= __lhs._M_state[__i] ^ __rhs._M_state[__i];
+
+ return (__int128) __res == 0;
+ }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+ } // namespace
+
+#endif // __ARM_NEON
+
+#endif // _EXT_OPT_RANDOM_H
diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html
index 95386554471..34a9b2bce60 100644
--- a/libstdc++-v3/doc/html/faq.html
+++ b/libstdc++-v3/doc/html/faq.html
@@ -76,7 +76,8 @@
</a></dt><dt>6.9. <a href="faq.html#faq.easy_to_fix">
Aw, that's easy to fix!
</a></dt></dl></dd><dt></dt><dd><dl><dt>7.1. <a href="faq.html#faq.iterator_as_pod">
- string::iterator is not char*; vector&lt;T&gt;::iterator is not T*
+ string::iterator is not char*;
+ vector&lt;T&gt;::iterator is not T*
</a></dt><dt>7.2. <a href="faq.html#faq.what_is_next">
What's next after libstdc++?
</a></dt><dt>7.3. <a href="faq.html#faq.sgi_stl">
@@ -133,10 +134,10 @@
<a class="link" href="https://gcc.gnu.org/buildstat.html" target="_top">portability</a>
that are the hallmarks of an open-source project are applied to libstdc++.
</p><p>
- All of the standard classes and functions from C++98/C++03
+ All of the standard classes and functions from C++98/C++03, C++11 and C++14
(such as <code class="classname">string</code>,
<code class="classname">vector&lt;&gt;</code>, iostreams, algorithms etc.)
- are freely available and atempt to be fully compliant.
+ are freely available and attempt to be fully compliant.
Work is ongoing to complete support for the current revision of the
ISO C++ Standard.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.who"></a><a id="q-who"></a><p><strong>1.3.</strong></p></td><td align="left" valign="top"><p>
@@ -431,7 +432,7 @@
C++ compiler.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.solaris_long_long"></a><a id="q-solaris_long_long"></a><p><strong>4.2.</strong></p></td><td align="left" valign="top"><p>
No '<span class="type">long long</span>' type on Solaris?
- </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-solaris_long_long"></a></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-solaris_long_long"></a></td><td align="left" valign="top"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This answer is old and probably no longer be relevant.</p></div><p>
By default we try to support the C99 <span class="type">long long</span> type.
This requires that certain functions from your C library be present.
</p><p>
@@ -509,7 +510,7 @@
more recent the C library. (This is also documented in the main
GCC installation instructions.)
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.freebsd_wchar"></a><a id="q-freebsd_wchar"></a><p><strong>4.8.</strong></p></td><td align="left" valign="top"><p>
- Can't use wchar_t/wstring on FreeBSD
+ Can't use <span class="type">wchar_t</span>/<code class="classname">wstring</code> on FreeBSD
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-freebsd_wchar"></a></td><td align="left" valign="top"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This answer is old and probably no longer be relevant.</p></div><p>
Older versions of FreeBSD's C library do not have sufficient
support for wide character functions, and as a result the
@@ -552,7 +553,8 @@
place), a public list of the library defects is occasionally
published on <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/" target="_top">the WG21
website</a>.
- Many of these issues have resulted in code changes in libstdc++.
+ Many of these issues have resulted in
+ <a class="link" href="manual/bugs.html#manual.intro.status.bugs.iso" title="Standard Bugs">code changes in libstdc++</a>.
</p><p>
If you think you've discovered a new bug that is not listed,
please post a message describing your problem to the author of
@@ -570,8 +572,8 @@
these lists with terms describing your issue.
</p><p>
Before reporting a bug, please examine the
- <a class="link" href="http://gcc.gnu.org/bugs/" target="_top">bugs database</a> with the
- category set to <span class="quote">“<span class="quote">g++</span>”</span>.
+ <a class="link" href="https://gcc.gnu.org/bugs/" target="_top">bugs database</a>, with the
+ component set to <span class="quote">“<span class="quote">c++</span>”</span>.
</p></td></tr><tr class="toc"><td align="left" valign="top" colspan="2"><dl><dt>6.1. <a href="faq.html#faq.stream_reopening_fails">
Reopening a stream fails
</a></dt><dt>6.2. <a href="faq.html#faq.wefcxx_verbose">
@@ -594,8 +596,9 @@
Aw, that's easy to fix!
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.stream_reopening_fails"></a><a id="q-stream_reopening_fails"></a><p><strong>6.1.</strong></p></td><td align="left" valign="top"><p>
Reopening a stream fails
- </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-stream_reopening_fails"></a></td><td align="left" valign="top"><p>
- One of the most-reported non-bug reports. Executing a sequence like:
+ </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-stream_reopening_fails"></a></td><td align="left" valign="top"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This answer is old and probably no longer be relevant.</p></div><p>
+ Prior to GCC 4.0 this was one of the most-reported non-bug reports.
+ Executing a sequence like this would fail:
</p><pre class="programlisting">
#include &lt;fstream&gt;
...
@@ -606,19 +609,20 @@
fs.close();
fs.open("a_new_file");
</pre><p>
- All operations on the re-opened <code class="varname">fs</code> will fail, or at
- least act very strangely. Yes, they often will, especially if
- <code class="varname">fs</code> reached the EOF state on the previous file. The
- reason is that the state flags are <span class="emphasis"><em>not</em></span> cleared
- on a successful call to open(). The standard unfortunately did
- not specify behavior in this case, and to everybody's great sorrow,
- the <a class="link" href="manual/bugs.html" title="Bugs">proposed LWG resolution in
- DR #22</a> is to leave the flags unchanged. You must insert a call
- to <code class="function">fs.clear()</code> between the calls to close() and open(),
- and then everything will work like we all expect it to work.
- <span class="emphasis"><em>Update:</em></span> for GCC 4.0 we implemented the resolution
- of <a class="link" href="manual/bugs.html" title="Bugs">DR #409</a> and open()
- now calls <code class="function">clear()</code> on success!
+ All operations on the re-opened <code class="varname">fs</code> would fail, or at
+ least act very strangely, especially if <code class="varname">fs</code> reached the
+ EOF state on the previous file.
+ The original C++98 standard did not specify behavior in this case, and
+ the <a class="link" href="manual/bugs.html#manual.bugs.dr22">resolution of DR #22</a> was to
+ leave the state flags unchanged on a successful call to
+ <code class="function">open()</code>.
+ You had to insert a call to <code class="function">fs.clear()</code> between the
+ calls to <code class="function">close()</code> and <code class="function">open()</code>,
+ and then everything will work as expected.
+ <span class="emphasis"><em>Update:</em></span> For GCC 4.0 we implemented the resolution
+ of <a class="link" href="manual/bugs.html#manual.bugs.dr409">DR #409</a> and
+ <code class="function">open()</code>
+ now calls <code class="function">clear()</code> on success.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.wefcxx_verbose"></a><a id="q-wefcxx_verbose"></a><p><strong>6.2.</strong></p></td><td align="left" valign="top"><p>
-Weffc++ complains too much
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-wefcxx_verbose"></a></td><td align="left" valign="top"><p>
@@ -626,7 +630,9 @@
libstdc++ <code class="option">-Weffc++</code>-clean is not a goal of the project,
for a few reasons. Mainly, that option tries to enforce
object-oriented programming, while the Standard Library isn't
- necessarily trying to be OO.
+ necessarily trying to be OO. The option also enforces outdated guidelines
+ from old editions of the books, and the advice isn't all relevant to
+ modern C++ (especially C++11 and later).
</p><p>
We do, however, try to have libstdc++ sources as clean as possible. If
you see some simple changes that pacify <code class="option">-Weffc++</code>
@@ -637,15 +643,16 @@
Another problem is the <code class="literal">rel_ops</code> namespace and the template
comparison operator functions contained therein. If they become
visible in the same namespace as other comparison functions
- (e.g., <span class="quote">“<span class="quote">using</span>”</span> them and the &lt;iterator&gt; header),
+ (e.g., <span class="quote">“<span class="quote">using</span>”</span> them and the
+ <code class="filename">&lt;iterator&gt;</code> header),
then you will suddenly be faced with huge numbers of ambiguity
- errors. This was discussed on the -v3 list; Nathan Myers
+ errors. This was discussed on the mailing list; Nathan Myers
<a class="link" href="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html" target="_top">sums
things up here</a>. The collisions with vector/string iterator
types have been fixed for 3.1.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.v2_headers"></a><a id="q-v2_headers"></a><p><strong>6.4.</strong></p></td><td align="left" valign="top"><p>
The g++-3 headers are <span class="emphasis"><em>not ours</em></span>
- </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-v2_headers"></a></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-v2_headers"></a></td><td align="left" valign="top"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This answer is old and probably no longer be relevant.</p></div><p>
If you are using headers in
<code class="filename">${prefix}/include/g++-3</code>, or if
the installed library's name looks like
@@ -698,11 +705,12 @@
    <span class="command"><strong>g++ -fPIC -rdynamic -o foo ... -L. -lfoo -ldl</strong></span><br />
    </p></div></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.memory_leaks"></a><a id="q-memory_leaks"></a><p><strong>6.7.</strong></p></td><td align="left" valign="top"><p>
<span class="quote">“<span class="quote">Memory leaks</span>”</span> in containers
- </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-memory_leaks"></a></td><td align="left" valign="top"><p>
+ </p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-memory_leaks"></a></td><td align="left" valign="top"><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This answer is old and probably no longer be relevant.</p></div><p>
A few people have reported that the standard containers appear
to leak memory when tested with memory checkers such as
<a class="link" href="http://valgrind.org/" target="_top"><span class="command"><strong>valgrind</strong></span></a>.
- Under some configurations the library's allocators keep free memory in a
+ Under some (non-default) configurations the library's allocators keep
+ free memory in a
pool for later reuse, rather than returning it to the OS. Although
this memory is always reachable by the library and is never
lost, memory debugging tools can report it as a leak. If you
@@ -710,7 +718,7 @@
<a class="link" href="manual/debug.html#debug.memory" title="Memory Leak Hunting">Tips for memory leak hunting</a>
first.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.list_size_on"></a><a id="q-list_size_on"></a><p><strong>6.8.</strong></p></td><td align="left" valign="top"><p>
- list::size() is O(n)!
+ <code class="code">list::size()</code> is O(n)!
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-list_size_on"></a></td><td align="left" valign="top"><p>
See
the <a class="link" href="manual/containers.html" title="Chapter 9.  Containers">Containers</a>
@@ -734,7 +742,8 @@
creeps back in, it will be caught immediately by the testsuite -
but only if such a test exists.
</p></td></tr><tr class="toc"><td align="left" valign="top" colspan="2"><dl><dt>7.1. <a href="faq.html#faq.iterator_as_pod">
- string::iterator is not char*; vector&lt;T&gt;::iterator is not T*
+ string::iterator is not char*;
+ vector&lt;T&gt;::iterator is not T*
</a></dt><dt>7.2. <a href="faq.html#faq.what_is_next">
What's next after libstdc++?
</a></dt><dt>7.3. <a href="faq.html#faq.sgi_stl">
@@ -749,7 +758,8 @@
</a></dt><dt>7.8. <a href="faq.html#faq.size_equals_capacity">
How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size?
</a></dt></dl></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.iterator_as_pod"></a><a id="faq.iterator_as_pod_q"></a><p><strong>7.1.</strong></p></td><td align="left" valign="top"><p>
- string::iterator is not char*; vector&lt;T&gt;::iterator is not T*
+ <code class="classname">string::iterator</code> is not <code class="code">char*</code>;
+ <code class="classname">vector&lt;T&gt;::iterator</code> is not <code class="code">T*</code>
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="faq.iterator_as_pod_a"></a></td><td align="left" valign="top"><p>
If you have code that depends on container&lt;T&gt; iterators
being implemented as pointer-to-T, your code is broken. It's
@@ -762,38 +772,38 @@
than a typedef for <span class="type">T*</span> outweighs nearly all opposing
arguments.
</p><p>
- Code which does assume that a vector iterator <code class="varname">i</code>
+ Code which does assume that a vector/string iterator <code class="varname">i</code>
is a pointer can often be fixed by changing <code class="varname">i</code> in
- certain expressions to <code class="varname">&amp;*i</code>. Future revisions
- of the Standard are expected to bless this usage for
- vector&lt;&gt; (but not for basic_string&lt;&gt;).
+ certain expressions to <code class="varname">&amp;*i</code>.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.what_is_next"></a><a id="q-what_is_next"></a><p><strong>7.2.</strong></p></td><td align="left" valign="top"><p>
What's next after libstdc++?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-what_is_next"></a></td><td align="left" valign="top"><p>
- Hopefully, not much. The goal of libstdc++ is to produce a
- fully-compliant, fully-portable Standard Library. After that,
- we're mostly done: there won't <span class="emphasis"><em>be</em></span> any
- more compliance work to do.
- </p><p>
- There is an effort underway to add significant extensions to
- the standard library specification. The latest version of
- this effort is described in
- <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">
- The C++ Library Technical Report 1</a>.
+ The goal of libstdc++ is to produce a
+ fully-compliant, fully-portable Standard Library.
+ While the C++ Standard continues to evolve the libstdc++ will
+ continue to track it.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.sgi_stl"></a><a id="q-sgi_stl"></a><p><strong>7.3.</strong></p></td><td align="left" valign="top"><p>
What about the STL from SGI?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-sgi_stl"></a></td><td align="left" valign="top"><p>
- The <a class="link" href="http://www.sgi.com/tech/stl/" target="_top">STL from SGI</a>,
- version 3.3, was the final merge of the STL codebase. The
- code in libstdc++ contains many fixes and changes, and
- the SGI code is no longer under active
- development. We expect that no future merges will take place.
+ The STL (Standard Template Library) was the inspiration for large chunks
+ of the C++ Standard Library, but the terms are not interchangeable and
+ they don't mean the same thing. The C++ Standard Library includes lots of
+ things that didn't come from the STL, and some of them aren't even
+ templates, such as <code class="classname">std::locale</code> and
+ <code class="classname">std::thread</code>.
+ </p><p>
+ Libstdc++-v3 incorporates a lot of code from
+ <a class="link" href="http://www.sgi.com/tech/stl/" target="_top">the SGI STL</a>
+ (the final merge was from
+ <a class="link" href="http://www.sgi.com/tech/stl/whats_new.html" target="_top">release 3.3</a>).
+ The code in libstdc++ contains many fixes and changes compared to the
+ original SGI code.
</p><p>
In particular, <code class="classname">string</code> is not from SGI and makes no
- use of their "rope" class (which is included as an
- optional extension), nor is <code class="classname">valarray</code> and some others.
- Classes like <code class="classname">vector&lt;&gt;</code> are, but have been
- extensively modified.
+ use of their "rope" class (although that is included as an optional
+ extension), neither is <code class="classname">valarray</code> nor some others.
+ Classes like <code class="classname">vector&lt;&gt;</code> were from SGI, but have
+ been extensively modified.
</p><p>
More information on the evolution of libstdc++ can be found at the
<a class="link" href="manual/api.html" title="API Evolution and Deprecation History">API
@@ -812,13 +822,17 @@
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-tr1_support"></a></td><td align="left" valign="top"><p>
Yes.
</p><p>
- The C++ Standard Library Technical Report adds many new features to
- the library. The latest version of this effort is described in
+ The C++ Standard Library
<a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf" target="_top">
- Technical Report 1</a>.
+ Technical Report 1</a> added many new features to the library.
</p><p>
- The implementation status of TR1 in libstdc++ can be tracked <a class="link" href="manual/status.html#status.iso.tr1" title="C++ TR1">on the TR1 status
- page</a>.
+ The implementation status of TR1 in libstdc++ can be tracked
+ <a class="link" href="manual/status.html#status.iso.tr1" title="C++ TR1">on the TR1 status page</a>.
+ </p><p>
+ New code should probably not use TR1, because almost everything in it has
+ been added to the main C++ Standard Library (usually with significant
+ improvements).
+ The TR1 implementation in libstdc++ is no longer actively maintained.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.get_iso_cxx"></a><a id="q-get_iso_cxx"></a><p><strong>7.6.</strong></p></td><td align="left" valign="top"><p>How do I get a copy of the ISO C++ Standard?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-get_iso_cxx"></a></td><td align="left" valign="top"><p>
Please refer to the <a class="link" href="manual/appendix_contributing.html" title="Appendix A.  Contributing">Contributing</a>
@@ -878,10 +892,14 @@
the decisions, must happen before you can reasonably document a
candidate C++ ABI that encompasses the standard library.
</p></td></tr><tr class="question"><td align="left" valign="top"><a id="faq.size_equals_capacity"></a><a id="q-size_equals_capacity"></a><p><strong>7.8.</strong></p></td><td align="left" valign="top"><p>
- How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size?
+ How do I make <code class="code">std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size</code>?
</p></td></tr><tr class="answer"><td align="left" valign="top"><a id="a-size_equals_capacity"></a></td><td align="left" valign="top"><p>
- The standard idiom for deallocating a <code class="classname">vector&lt;T&gt;</code>'s
- unused memory is to create a temporary copy of the vector and swap their
+ Since C++11 just call the <code class="function">shrink_to_fit()</code> member
+ function.
+ </p><p>
+ Before C++11, the standard idiom for deallocating a
+ <code class="classname">vector&lt;T&gt;</code>'s
+ unused memory was to create a temporary copy of the vector and swap their
contents, e.g. for <code class="classname">vector&lt;T&gt; v</code>
</p><div class="literallayout"><p><br />
     std::vector&lt;T&gt;(v).swap(v);<br />
diff --git a/libstdc++-v3/doc/html/manual/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index 1cdbf398dce..1ed199e432e 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Bugs</title><meta name="generator" content="DocBook XSL-NS Stylesheets V1.78.1" /><meta name="keywords" content="ISO C++, library" /><meta name="keywords" content="ISO C++, runtime, library" /><link rel="home" href="../index.html" title="The GNU C++ Library" /><link rel="up" href="status.html" title="Chapter 1. Status" /><link rel="prev" href="license.html" title="License" /><link rel="next" href="setup.html" title="Chapter 2. Setup" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Bugs</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="license.html">Prev</a> </td><th width="60%" align="center">Chapter 1. Status</th><td width="20%" align="right"> <a accesskey="n" href="setup.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="manual.intro.status.bugs"></a>Bugs</h2></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.impl"></a>Implementation Bugs</h3></div></div></div><p>
Information on known bugs, details on efforts to fix them, and
- fixed bugs are all available as part of the <a class="link" href="http://gcc.gnu.org/bugs/" target="_top">GCC bug tracking system</a>,
- with the category set to <code class="literal">libstdc++</code>.
+ fixed bugs are all available as part of the <a class="link" href="https://gcc.gnu.org/bugs/" target="_top">GCC bug tracking system</a>,
+ under the component <span class="quote">“<span class="quote">libstdc++</span>”</span>.
</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="manual.intro.status.bugs.iso"></a>Standard Bugs</h3></div></div></div><p>
Everybody's got issues. Even the C++ Standard Library.
</p><p>
@@ -12,219 +12,221 @@
a consensus on proposed solutions, we often incorporate the solution.
</p><p>
Here are the issues which have resulted in code changes to the library.
- The links are to the specific defect reports from a <span class="emphasis"><em>partial
- copy</em></span> of the Issues List. You can read the full version online
+ The links are to the full version of the Issues List.
+ You can read the full version online
at the <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/" target="_top">ISO C++
Committee homepage</a>.
</p><p>
If a DR is not listed here, we may simply not have gotten to
- it yet; feel free to submit a patch. Search the include/bits
- and src directories for appearances of
+ it yet; feel free to submit a patch. Search the
+ <code class="filename">include</code> and
+ <code class="filename">src</code>
+ directories for appearances of
<code class="constant">_GLIBCXX_RESOLVE_LIB_DEFECTS</code> for examples
of style. Note that we usually do not make changes to the
code until an issue has reached <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#DR" target="_top">DR</a> status.
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#5" target="_top">5</a>:
+ </p><div class="variablelist"><dl class="variablelist"><dt><a id="manual.bugs.dr5"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#5" target="_top">5</a>:
<span class="emphasis"><em>string::compare specification questionable</em></span>
</span></dt><dd><p>This should be two overloaded functions rather than a single function.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#17" target="_top">17</a>:
+ </p></dd><dt><a id="manual.bugs.dr17"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#17" target="_top">17</a>:
<span class="emphasis"><em>Bad bool parsing</em></span>
</span></dt><dd><p>Apparently extracting Boolean values was messed up...
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#19" target="_top">19</a>:
+ </p></dd><dt><a id="manual.bugs.dr19"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#19" target="_top">19</a>:
<span class="emphasis"><em>"Noconv" definition too vague</em></span>
</span></dt><dd><p>If <code class="code">codecvt::do_in</code> returns <code class="code">noconv</code> there are
no changes to the values in <code class="code">[to, to_limit)</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#22" target="_top">22</a>:
+ </p></dd><dt><a id="manual.bugs.dr22"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#22" target="_top">22</a>:
<span class="emphasis"><em>Member open vs flags</em></span>
</span></dt><dd><p>Re-opening a file stream does <span class="emphasis"><em>not</em></span> clear the state flags.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#23" target="_top">23</a>:
+ </p></dd><dt><a id="manual.bugs.dr23"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#23" target="_top">23</a>:
<span class="emphasis"><em>Num_get overflow result</em></span>
</span></dt><dd><p>Implement the proposed resolution.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#25" target="_top">25</a>:
+ </p></dd><dt><a id="manual.bugs.dr25"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#25" target="_top">25</a>:
<span class="emphasis"><em>String operator&lt;&lt; uses width() value wrong</em></span>
</span></dt><dd><p>Padding issues.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#48" target="_top">48</a>:
+ </p></dd><dt><a id="manual.bugs.dr48"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#48" target="_top">48</a>:
<span class="emphasis"><em>Use of non-existent exception constructor</em></span>
</span></dt><dd><p>An instance of <code class="code">ios_base::failure</code> is constructed instead.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#49" target="_top">49</a>:
+ </p></dd><dt><a id="manual.bugs.dr49"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#49" target="_top">49</a>:
<span class="emphasis"><em>Underspecification of ios_base::sync_with_stdio</em></span>
</span></dt><dd><p>The return type is the <span class="emphasis"><em>previous</em></span> state of synchronization.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#50" target="_top">50</a>:
+ </p></dd><dt><a id="manual.bugs.dr50"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#50" target="_top">50</a>:
<span class="emphasis"><em>Copy constructor and assignment operator of ios_base</em></span>
</span></dt><dd><p>These members functions are declared <code class="code">private</code> and are
thus inaccessible. Specifying the correct semantics of
"copying stream state" was deemed too complicated.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#60" target="_top">60</a>:
+ </p></dd><dt><a id="manual.bugs.dr60"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#60" target="_top">60</a>:
<span class="emphasis"><em>What is a formatted input function?</em></span>
</span></dt><dd><p>This DR made many widespread changes to <code class="code">basic_istream</code>
and <code class="code">basic_ostream</code> all of which have been implemented.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#63" target="_top">63</a>:
+ </p></dd><dt><a id="manual.bugs.dr63"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#63" target="_top">63</a>:
<span class="emphasis"><em>Exception-handling policy for unformatted output</em></span>
</span></dt><dd><p>Make the policy consistent with that of formatted input, unformatted
input, and formatted output.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#68" target="_top">68</a>:
+ </p></dd><dt><a id="manual.bugs.dr68"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#68" target="_top">68</a>:
<span class="emphasis"><em>Extractors for char* should store null at end</em></span>
</span></dt><dd><p>And they do now. An editing glitch in the last item in the list of
[27.6.1.2.3]/7.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#74" target="_top">74</a>:
+ </p></dd><dt><a id="manual.bugs.dr74"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#74" target="_top">74</a>:
<span class="emphasis"><em>Garbled text for codecvt::do_max_length</em></span>
</span></dt><dd><p>The text of the standard was gibberish. Typos gone rampant.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#75" target="_top">75</a>:
+ </p></dd><dt><a id="manual.bugs.dr75"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#75" target="_top">75</a>:
<span class="emphasis"><em>Contradiction in codecvt::length's argument types</em></span>
</span></dt><dd><p>Change the first parameter to <code class="code">stateT&amp;</code> and implement
the new effects paragraph.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#83" target="_top">83</a>:
+ </p></dd><dt><a id="manual.bugs.dr83"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#83" target="_top">83</a>:
<span class="emphasis"><em>string::npos vs. string::max_size()</em></span>
</span></dt><dd><p>Safety checks on the size of the string should test against
<code class="code">max_size()</code> rather than <code class="code">npos</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#90" target="_top">90</a>:
+ </p></dd><dt><a id="manual.bugs.dr90"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#90" target="_top">90</a>:
<span class="emphasis"><em>Incorrect description of operator&gt;&gt; for strings</em></span>
</span></dt><dd><p>The effect contain <code class="code">isspace(c,getloc())</code> which must be
replaced by <code class="code">isspace(c,is.getloc())</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#91" target="_top">91</a>:
+ </p></dd><dt><a id="manual.bugs.dr91"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#91" target="_top">91</a>:
<span class="emphasis"><em>Description of operator&gt;&gt; and getline() for string&lt;&gt;
might cause endless loop</em></span>
</span></dt><dd><p>They behave as a formatted input function and as an unformatted
input function, respectively (except that <code class="code">getline</code> is
not required to set <code class="code">gcount</code>).
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#103" target="_top">103</a>:
+ </p></dd><dt><a id="manual.bugs.dr103"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#103" target="_top">103</a>:
<span class="emphasis"><em>set::iterator is required to be modifiable, but this allows
modification of keys.</em></span>
</span></dt><dd><p>For associative containers where the value type is the same as
the key type, both <code class="code">iterator</code> and <code class="code">const_iterator
</code> are constant iterators.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#109" target="_top">109</a>:
+ </p></dd><dt><a id="manual.bugs.dr109"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#109" target="_top">109</a>:
<span class="emphasis"><em>Missing binders for non-const sequence elements</em></span>
</span></dt><dd><p>The <code class="code">binder1st</code> and <code class="code">binder2nd</code> didn't have an
<code class="code">operator()</code> taking a non-const parameter.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#110" target="_top">110</a>:
+ </p></dd><dt><a id="manual.bugs.dr110"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#110" target="_top">110</a>:
<span class="emphasis"><em>istreambuf_iterator::equal not const</em></span>
</span></dt><dd><p>This was not a const member function. Note that the DR says to
replace the function with a const one; we have instead provided an
overloaded version with identical contents.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#117" target="_top">117</a>:
+ </p></dd><dt><a id="manual.bugs.dr117"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#117" target="_top">117</a>:
<span class="emphasis"><em>basic_ostream uses nonexistent num_put member functions</em></span>
</span></dt><dd><p><code class="code">num_put::put()</code> was overloaded on the wrong types.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#118" target="_top">118</a>:
+ </p></dd><dt><a id="manual.bugs.dr118"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#118" target="_top">118</a>:
<span class="emphasis"><em>basic_istream uses nonexistent num_get member functions</em></span>
</span></dt><dd><p>Same as 117, but for <code class="code">num_get::get()</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#129" target="_top">129</a>:
+ </p></dd><dt><a id="manual.bugs.dr129"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#129" target="_top">129</a>:
<span class="emphasis"><em>Need error indication from seekp() and seekg()</em></span>
</span></dt><dd><p>These functions set <code class="code">failbit</code> on error now.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#130" target="_top">130</a>:
+ </p></dd><dt><a id="manual.bugs.dr130"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#130" target="_top">130</a>:
<span class="emphasis"><em>Return type of container::erase(iterator) differs for associative containers</em></span>
</span></dt><dd><p>Make member <code class="code">erase</code> return iterator for <code class="code">set</code>, <code class="code">multiset</code>, <code class="code">map</code>, <code class="code">multimap</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#136" target="_top">136</a>:
+ </p></dd><dt><a id="manual.bugs.dr136"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#136" target="_top">136</a>:
<span class="emphasis"><em>seekp, seekg setting wrong streams?</em></span>
</span></dt><dd><p><code class="code">seekp</code> should only set the output stream, and
<code class="code">seekg</code> should only set the input stream.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#167" target="_top">167</a>:
+ </p></dd><dt><a id="manual.bugs.dr167"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#167" target="_top">167</a>:
<span class="emphasis"><em>Improper use of traits_type::length()</em></span>
</span></dt><dd><p><code class="code">op&lt;&lt;</code> with a <code class="code">const char*</code> was
calculating an incorrect number of characters to write.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#169" target="_top">169</a>:
+ </p></dd><dt><a id="manual.bugs.dr169"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#169" target="_top">169</a>:
<span class="emphasis"><em>Bad efficiency of overflow() mandated</em></span>
</span></dt><dd><p>Grow efficiently the internal array object.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#171" target="_top">171</a>:
+ </p></dd><dt><a id="manual.bugs.dr171"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#171" target="_top">171</a>:
<span class="emphasis"><em>Strange seekpos() semantics due to joint position</em></span>
</span></dt><dd><p>Quite complex to summarize...
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#181" target="_top">181</a>:
+ </p></dd><dt><a id="manual.bugs.dr181"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#181" target="_top">181</a>:
<span class="emphasis"><em>make_pair() unintended behavior</em></span>
</span></dt><dd><p>This function used to take its arguments as reference-to-const, now
it copies them (pass by value).
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#195" target="_top">195</a>:
+ </p></dd><dt><a id="manual.bugs.dr195"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#195" target="_top">195</a>:
<span class="emphasis"><em>Should basic_istream::sentry's constructor ever set eofbit?</em></span>
</span></dt><dd><p>Yes, it can, specifically if EOF is reached while skipping whitespace.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#211" target="_top">211</a>:
+ </p></dd><dt><a id="manual.bugs.dr211"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#211" target="_top">211</a>:
<span class="emphasis"><em>operator&gt;&gt;(istream&amp;, string&amp;) doesn't set failbit</em></span>
</span></dt><dd><p>If nothing is extracted into the string, <code class="code">op&gt;&gt;</code> now
sets <code class="code">failbit</code> (which can cause an exception, etc., etc.).
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#214" target="_top">214</a>:
+ </p></dd><dt><a id="manual.bugs.dr214"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#214" target="_top">214</a>:
<span class="emphasis"><em>set::find() missing const overload</em></span>
</span></dt><dd><p>Both <code class="code">set</code> and <code class="code">multiset</code> were missing
overloaded find, lower_bound, upper_bound, and equal_range functions
for const instances.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#231" target="_top">231</a>:
+ </p></dd><dt><a id="manual.bugs.dr231"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#231" target="_top">231</a>:
<span class="emphasis"><em>Precision in iostream?</em></span>
</span></dt><dd><p>For conversion from a floating-point type, <code class="code">str.precision()</code>
is specified in the conversion specification.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#233" target="_top">233</a>:
+ </p></dd><dt><a id="manual.bugs.dr233"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#233" target="_top">233</a>:
<span class="emphasis"><em>Insertion hints in associative containers</em></span>
</span></dt><dd><p>Implement N1780, first check before then check after, insert as close
to hint as possible.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#235" target="_top">235</a>:
+ </p></dd><dt><a id="manual.bugs.dr235"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#235" target="_top">235</a>:
<span class="emphasis"><em>No specification of default ctor for reverse_iterator</em></span>
</span></dt><dd><p>The declaration of <code class="code">reverse_iterator</code> lists a default constructor.
However, no specification is given what this constructor should do.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#241" target="_top">241</a>:
+ </p></dd><dt><a id="manual.bugs.dr241"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#241" target="_top">241</a>:
<span class="emphasis"><em>Does unique_copy() require CopyConstructible and Assignable?</em></span>
</span></dt><dd><p>Add a helper for forward_iterator/output_iterator, fix the existing
one for input_iterator/output_iterator to not rely on Assignability.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#243" target="_top">243</a>:
+ </p></dd><dt><a id="manual.bugs.dr243"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#243" target="_top">243</a>:
<span class="emphasis"><em>get and getline when sentry reports failure</em></span>
</span></dt><dd><p>Store a null character only if the character array has a non-zero size.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#251" target="_top">251</a>:
+ </p></dd><dt><a id="manual.bugs.dr251"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#251" target="_top">251</a>:
<span class="emphasis"><em>basic_stringbuf missing allocator_type</em></span>
</span></dt><dd><p>This nested typedef was originally not specified.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#253" target="_top">253</a>:
+ </p></dd><dt><a id="manual.bugs.dr253"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#253" target="_top">253</a>:
<span class="emphasis"><em>valarray helper functions are almost entirely useless</em></span>
</span></dt><dd><p>Make the copy constructor and copy-assignment operator declarations
public in gslice_array, indirect_array, mask_array, slice_array; provide
definitions.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#265" target="_top">265</a>:
+ </p></dd><dt><a id="manual.bugs.dr265"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#265" target="_top">265</a>:
<span class="emphasis"><em>std::pair::pair() effects overly restrictive</em></span>
</span></dt><dd><p>The default ctor would build its members from copies of temporaries;
now it simply uses their respective default ctors.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#266" target="_top">266</a>:
+ </p></dd><dt><a id="manual.bugs.dr266"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#266" target="_top">266</a>:
<span class="emphasis"><em>bad_exception::~bad_exception() missing Effects clause</em></span>
</span></dt><dd><p>The <code class="code">bad_</code>* classes no longer have destructors (they
are trivial), since no description of them was ever given.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#271" target="_top">271</a>:
+ </p></dd><dt><a id="manual.bugs.dr271"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#271" target="_top">271</a>:
<span class="emphasis"><em>basic_iostream missing typedefs</em></span>
</span></dt><dd><p>The typedefs it inherits from its base classes can't be used, since
(for example) <code class="code">basic_iostream&lt;T&gt;::traits_type</code> is ambiguous.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#275" target="_top">275</a>:
+ </p></dd><dt><a id="manual.bugs.dr275"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#275" target="_top">275</a>:
<span class="emphasis"><em>Wrong type in num_get::get() overloads</em></span>
</span></dt><dd><p>Similar to 118.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#280" target="_top">280</a>:
+ </p></dd><dt><a id="manual.bugs.dr280"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#280" target="_top">280</a>:
<span class="emphasis"><em>Comparison of reverse_iterator to const reverse_iterator</em></span>
</span></dt><dd><p>Add global functions with two template parameters.
(NB: not added for now a templated assignment operator)
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#292" target="_top">292</a>:
+ </p></dd><dt><a id="manual.bugs.dr292"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#292" target="_top">292</a>:
<span class="emphasis"><em>Effects of a.copyfmt (a)</em></span>
</span></dt><dd><p>If <code class="code">(this == &amp;rhs)</code> do nothing.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#300" target="_top">300</a>:
+ </p></dd><dt><a id="manual.bugs.dr300"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#300" target="_top">300</a>:
<span class="emphasis"><em>List::merge() specification incomplete</em></span>
</span></dt><dd><p>If <code class="code">(this == &amp;x)</code> do nothing.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#303" target="_top">303</a>:
+ </p></dd><dt><a id="manual.bugs.dr303"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#303" target="_top">303</a>:
<span class="emphasis"><em>Bitset input operator underspecified</em></span>
</span></dt><dd><p>Basically, compare the input character to
<code class="code">is.widen(0)</code> and <code class="code">is.widen(1)</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#305" target="_top">305</a>:
+ </p></dd><dt><a id="manual.bugs.dr305"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#305" target="_top">305</a>:
<span class="emphasis"><em>Default behavior of codecvt&lt;wchar_t, char,
mbstate_t&gt;::length()</em></span>
</span></dt><dd><p>Do not specify what <code class="code">codecvt&lt;wchar_t, char,
mbstate_t&gt;::do_length</code> must return.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#328" target="_top">328</a>:
+ </p></dd><dt><a id="manual.bugs.dr328"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#328" target="_top">328</a>:
<span class="emphasis"><em>Bad sprintf format modifier in
money_put&lt;&gt;::do_put()</em></span>
</span></dt><dd><p>Change the format string to "%.0Lf".
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#365" target="_top">365</a>:
+ </p></dd><dt><a id="manual.bugs.dr365"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#365" target="_top">365</a>:
<span class="emphasis"><em>Lack of const-qualification in clause 27</em></span>
</span></dt><dd><p>Add const overloads of <code class="code">is_open</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#387" target="_top">387</a>:
+ </p></dd><dt><a id="manual.bugs.dr387"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#387" target="_top">387</a>:
<span class="emphasis"><em>std::complex over-encapsulated</em></span>
</span></dt><dd><p>Add the <code class="code">real(T)</code> and <code class="code">imag(T)</code>
members; in C++11 mode, also adjust the existing
<code class="code">real()</code> and <code class="code">imag()</code> members and
free functions.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#389" target="_top">389</a>:
+ </p></dd><dt><a id="manual.bugs.dr389"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#389" target="_top">389</a>:
<span class="emphasis"><em>Const overload of valarray::operator[] returns
by value</em></span>
</span></dt><dd><p>Change it to return a <code class="code">const T&amp;</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#396" target="_top">396</a>:
+ </p></dd><dt><a id="manual.bugs.dr396"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#396" target="_top">396</a>:
<span class="emphasis"><em>what are characters zero and one</em></span>
</span></dt><dd><p>Implement the proposed resolution.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#402" target="_top">402</a>:
+ </p></dd><dt><a id="manual.bugs.dr402"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#402" target="_top">402</a>:
<span class="emphasis"><em>Wrong new expression in [some_]allocator::construct</em></span>
</span></dt><dd><p>Replace "new" with "::new".
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-closed.html#408" target="_top">408</a>:
@@ -232,39 +234,39 @@
Is vector&lt;reverse_iterator&lt;char*&gt; &gt; forbidden?
</em></span>
</span></dt><dd><p>Tweak the debug-mode checks in _Safe_iterator.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#409" target="_top">409</a>:
+ </p></dd><dt><a id="manual.bugs.dr409"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#409" target="_top">409</a>:
<span class="emphasis"><em>Closing an fstream should clear the error state</em></span>
</span></dt><dd><p>Have <code class="code">open</code> clear the error flags.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-closed.html#431" target="_top">431</a>:
<span class="emphasis"><em>Swapping containers with unequal allocators</em></span>
</span></dt><dd><p>Implement Option 3, as per N1599.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#432" target="_top">432</a>:
+ </p></dd><dt><a id="manual.bugs.dr432"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#432" target="_top">432</a>:
<span class="emphasis"><em>stringbuf::overflow() makes only one write position
available</em></span>
</span></dt><dd><p>Implement the resolution, beyond DR 169.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#434" target="_top">434</a>:
+ </p></dd><dt><a id="manual.bugs.dr434"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#434" target="_top">434</a>:
<span class="emphasis"><em>bitset::to_string() hard to use</em></span>
</span></dt><dd><p>Add three overloads, taking fewer template arguments.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#438" target="_top">438</a>:
+ </p></dd><dt><a id="manual.bugs.dr438"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#438" target="_top">438</a>:
<span class="emphasis"><em>Ambiguity in the "do the right thing" clause</em></span>
</span></dt><dd><p>Implement the resolution, basically cast less.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#445" target="_top">445</a>:
+ </p></dd><dt><a id="manual.bugs.dr445"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#445" target="_top">445</a>:
<span class="emphasis"><em>iterator_traits::reference unspecified for some iterator categories</em></span>
</span></dt><dd><p>Change <code class="code">istreambuf_iterator::reference</code> in C++11 mode.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#453" target="_top">453</a>:
+ </p></dd><dt><a id="manual.bugs.dr453"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#453" target="_top">453</a>:
<span class="emphasis"><em>basic_stringbuf::seekoff need not always fail for an empty stream</em></span>
</span></dt><dd><p>Don't fail if the next pointer is null and newoff is zero.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#455" target="_top">455</a>:
+ </p></dd><dt><a id="manual.bugs.dr455"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#455" target="_top">455</a>:
<span class="emphasis"><em>cerr::tie() and wcerr::tie() are overspecified</em></span>
</span></dt><dd><p>Initialize cerr tied to cout and wcerr tied to wcout.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#464" target="_top">464</a>:
+ </p></dd><dt><a id="manual.bugs.dr464"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#464" target="_top">464</a>:
<span class="emphasis"><em>Suggestion for new member functions in standard containers</em></span>
</span></dt><dd><p>Add <code class="code">data()</code> to <code class="code">std::vector</code> and
<code class="code">at(const key_type&amp;)</code> to <code class="code">std::map</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#467" target="_top">467</a>:
+ </p></dd><dt><a id="manual.bugs.dr467"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#467" target="_top">467</a>:
<span class="emphasis"><em>char_traits::lt(), compare(), and memcmp()</em></span>
</span></dt><dd><p>Change <code class="code">lt</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#508" target="_top">508</a>:
+ </p></dd><dt><a id="manual.bugs.dr508"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#508" target="_top">508</a>:
<span class="emphasis"><em>Bad parameters for ranlux64_base_01</em></span>
</span></dt><dd><p>Fix the parameters.
</p></dd><dt><span class="term"><a class="link" href="../ext/lwg-closed.html#512" target="_top">512</a>:
@@ -274,246 +276,246 @@
<span class="emphasis"><em>Is it undefined if a function in the standard changes in
parameters?</em></span>
</span></dt><dd><p>Use &amp;value.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#538" target="_top">538</a>:
+ </p></dd><dt><a id="manual.bugs.dr538"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#538" target="_top">538</a>:
<span class="emphasis"><em>241 again: Does unique_copy() require CopyConstructible
and Assignable?</em></span>
</span></dt><dd><p>In case of input_iterator/output_iterator rely on Assignability of
input_iterator' value_type.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#539" target="_top">539</a>:
+ </p></dd><dt><a id="manual.bugs.dr539"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#539" target="_top">539</a>:
<span class="emphasis"><em>partial_sum and adjacent_difference should mention
requirements</em></span>
</span></dt><dd><p>We were almost doing the right thing, just use std::move
in adjacent_difference.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#541" target="_top">541</a>:
+ </p></dd><dt><a id="manual.bugs.dr541"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#541" target="_top">541</a>:
<span class="emphasis"><em>shared_ptr template assignment and void</em></span>
</span></dt><dd><p>Add an auto_ptr&lt;void&gt; specialization.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#543" target="_top">543</a>:
+ </p></dd><dt><a id="manual.bugs.dr543"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#543" target="_top">543</a>:
<span class="emphasis"><em>valarray slice default constructor</em></span>
</span></dt><dd><p>Follow the straightforward proposed resolution.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#550" target="_top">550</a>:
+ </p></dd><dt><a id="manual.bugs.dr550"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#550" target="_top">550</a>:
<span class="emphasis"><em>What should the return type of pow(float,int) be?</em></span>
</span></dt><dd><p>In C++11 mode, remove the pow(float,int), etc., signatures.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#586" target="_top">586</a>:
+ </p></dd><dt><a id="manual.bugs.dr586"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#586" target="_top">586</a>:
<span class="emphasis"><em>string inserter not a formatted function</em></span>
</span></dt><dd><p>Change it to be a formatted output function (i.e. catch exceptions).
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#596" target="_top">596</a>:
+ </p></dd><dt><a id="manual.bugs.dr596"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#596" target="_top">596</a>:
<span class="emphasis"><em>27.8.1.3 Table 112 omits "a+" and "a+b" modes</em></span>
</span></dt><dd><p>Add the missing modes to fopen_mode.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#630" target="_top">630</a>:
+ </p></dd><dt><a id="manual.bugs.dr630"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#630" target="_top">630</a>:
<span class="emphasis"><em>arrays of valarray</em></span>
</span></dt><dd><p>Implement the simple resolution.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#660" target="_top">660</a>:
+ </p></dd><dt><a id="manual.bugs.dr660"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#660" target="_top">660</a>:
<span class="emphasis"><em>Missing bitwise operations</em></span>
</span></dt><dd><p>Add the missing operations.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#691" target="_top">691</a>:
+ </p></dd><dt><a id="manual.bugs.dr691"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#691" target="_top">691</a>:
<span class="emphasis"><em>const_local_iterator cbegin, cend missing from TR1</em></span>
</span></dt><dd><p>In C++11 mode add cbegin(size_type) and cend(size_type)
to the unordered containers.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#693" target="_top">693</a>:
+ </p></dd><dt><a id="manual.bugs.dr693"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#693" target="_top">693</a>:
<span class="emphasis"><em>std::bitset::all() missing</em></span>
</span></dt><dd><p>Add it, consistently with the discussion.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#695" target="_top">695</a>:
+ </p></dd><dt><a id="manual.bugs.dr695"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#695" target="_top">695</a>:
<span class="emphasis"><em>ctype&lt;char&gt;::classic_table() not accessible</em></span>
</span></dt><dd><p>Make the member functions table and classic_table public.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#696" target="_top">696</a>:
+ </p></dd><dt><a id="manual.bugs.dr696"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#696" target="_top">696</a>:
<span class="emphasis"><em>istream::operator&gt;&gt;(int&amp;) broken</em></span>
</span></dt><dd><p>Implement the straightforward resolution.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#761" target="_top">761</a>:
+ </p></dd><dt><a id="manual.bugs.dr761"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#761" target="_top">761</a>:
<span class="emphasis"><em>unordered_map needs an at() member function</em></span>
</span></dt><dd><p>In C++11 mode, add at() and at() const.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#775" target="_top">775</a>:
+ </p></dd><dt><a id="manual.bugs.dr775"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#775" target="_top">775</a>:
<span class="emphasis"><em>Tuple indexing should be unsigned?</em></span>
</span></dt><dd><p>Implement the int -&gt; size_t replacements.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776" target="_top">776</a>:
+ </p></dd><dt><a id="manual.bugs.dr776"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776" target="_top">776</a>:
<span class="emphasis"><em>Undescribed assign function of std::array</em></span>
</span></dt><dd><p>In C++11 mode, remove assign, add fill.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#781" target="_top">781</a>:
+ </p></dd><dt><a id="manual.bugs.dr781"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#781" target="_top">781</a>:
<span class="emphasis"><em>std::complex should add missing C99 functions</em></span>
</span></dt><dd><p>In C++11 mode, add std::proj.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#809" target="_top">809</a>:
+ </p></dd><dt><a id="manual.bugs.dr809"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#809" target="_top">809</a>:
<span class="emphasis"><em>std::swap should be overloaded for array types</em></span>
</span></dt><dd><p>Add the overload.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#853" target="_top">853</a>:
+ </p></dd><dt><a id="manual.bugs.dr853"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#853" target="_top">853</a>:
<span class="emphasis"><em>to_string needs updating with zero and one</em></span>
</span></dt><dd><p>Update / add the signatures.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#865" target="_top">865</a>:
+ </p></dd><dt><a id="manual.bugs.dr865"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#865" target="_top">865</a>:
<span class="emphasis"><em>More algorithms that throw away information</em></span>
</span></dt><dd><p>The traditional HP / SGI return type and value is blessed
by the resolution of the DR.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1339" target="_top">1339</a>:
+ </p></dd><dt><a id="manual.bugs.dr1339"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#1339" target="_top">1339</a>:
<span class="emphasis"><em>uninitialized_fill_n should return the end of its range</em></span>
</span></dt><dd><p>Return the end of the filled range.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2021" target="_top">2021</a>:
+ </p></dd><dt><a id="manual.bugs.dr2021"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2021" target="_top">2021</a>:
<span class="emphasis"><em>Further incorrect uses of <code class="code">result_of</code></em></span>
</span></dt><dd><p>Correctly decay types in signature of <code class="code">std::async</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2049" target="_top">2049</a>:
+ </p></dd><dt><a id="manual.bugs.dr2049"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2049" target="_top">2049</a>:
<span class="emphasis"><em><code class="code">is_destructible</code> underspecified</em></span>
</span></dt><dd><p>Handle non-object types.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2056" target="_top">2056</a>:
+ </p></dd><dt><a id="manual.bugs.dr2056"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2056" target="_top">2056</a>:
<span class="emphasis"><em>future_errc enums start with value 0 (invalid value for broken_promise)</em></span>
</span></dt><dd><p>Reorder enumerators.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2059" target="_top">2059</a>:
+ </p></dd><dt><a id="manual.bugs.dr2059"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2059" target="_top">2059</a>:
<span class="emphasis"><em>C++0x ambiguity problem with map::erase</em></span>
</span></dt><dd><p>Add additional overloads.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2062" target="_top">2062</a>:
+ </p></dd><dt><a id="manual.bugs.dr2062"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2062" target="_top">2062</a>:
<span class="emphasis"><em>2062. Effect contradictions w/o no-throw guarantee of <code class="code">std::function</code> swaps</em></span>
</span></dt><dd><p>Add <code class="code">noexcept</code> to swap functions.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2063" target="_top">2063</a>:
+ </p></dd><dt><a id="manual.bugs.dr2063"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2063" target="_top">2063</a>:
<span class="emphasis"><em>Contradictory requirements for string move assignment</em></span>
</span></dt><dd><p>Respect propagation trait for move assignment.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2064" target="_top">2064</a>:
+ </p></dd><dt><a id="manual.bugs.dr2064"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2064" target="_top">2064</a>:
<span class="emphasis"><em>More noexcept issues in basic_string</em></span>
</span></dt><dd><p>Add noexcept to the comparison operators.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2067" target="_top">2067</a>:
+ </p></dd><dt><a id="manual.bugs.dr2067"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2067" target="_top">2067</a>:
<span class="emphasis"><em>packaged_task should have deleted copy c'tor with const parameter</em></span>
</span></dt><dd><p>Fix signatures.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2101" target="_top">2101</a>:
+ </p></dd><dt><a id="manual.bugs.dr2101"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2101" target="_top">2101</a>:
<span class="emphasis"><em>Some transformation types can produce impossible types</em></span>
</span></dt><dd><p>Use the referenceable type concept.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2106" target="_top">2106</a>:
+ </p></dd><dt><a id="manual.bugs.dr2106"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2106" target="_top">2106</a>:
<span class="emphasis"><em>move_iterator wrapping iterators returning prvalues</em></span>
</span></dt><dd><p>Change the <code class="code">reference</code> type.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2108" target="_top">2108</a>:
+ </p></dd><dt><a id="manual.bugs.dr2108"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2108" target="_top">2108</a>:
<span class="emphasis"><em>No way to identify allocator types that always compare equal</em></span>
</span></dt><dd><p>Define and use <code class="code">is_always_equal</code> even for C++11.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2118" target="_top">2118</a>:
+ </p></dd><dt><a id="manual.bugs.dr2118"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2118" target="_top">2118</a>:
<span class="emphasis"><em><code class="code">unique_ptr</code> for array does not support cv qualification conversion of actual argument</em></span>
</span></dt><dd><p>Adjust constraints to allow safe conversions.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2127" target="_top">2127</a>:
+ </p></dd><dt><a id="manual.bugs.dr2127"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2127" target="_top">2127</a>:
<span class="emphasis"><em>Move-construction with <code class="code">raw_storage_iterator</code></em></span>
</span></dt><dd><p>Add assignment operator taking an rvalue.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2132" target="_top">2132</a>:
+ </p></dd><dt><a id="manual.bugs.dr2132"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2132" target="_top">2132</a>:
<span class="emphasis"><em><code class="code">std::function</code> ambiguity</em></span>
</span></dt><dd><p>Constrain the constructor to only accept callable types.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2141" target="_top">2141</a>:
+ </p></dd><dt><a id="manual.bugs.dr2141"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2141" target="_top">2141</a>:
<span class="emphasis"><em><code class="code">common_type</code> trait produces reference types</em></span>
</span></dt><dd><p>Use <code class="code">decay</code> for the result type.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2144" target="_top">2144</a>:
+ </p></dd><dt><a id="manual.bugs.dr2144"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2144" target="_top">2144</a>:
<span class="emphasis"><em>Missing <code class="code">noexcept</code> specification in <code class="code">type_index</code></em></span>
</span></dt><dd><p>Add <code class="code">noexcept</code>
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2145" target="_top">2145</a>:
+ </p></dd><dt><a id="manual.bugs.dr2145"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2145" target="_top">2145</a>:
<span class="emphasis"><em><code class="code">error_category</code> default constructor</em></span>
</span></dt><dd><p>Declare a public constexpr constructor.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2162" target="_top">2162</a>:
+ </p></dd><dt><a id="manual.bugs.dr2162"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2162" target="_top">2162</a>:
<span class="emphasis"><em><code class="code">allocator_traits::max_size</code> missing <code class="code">noexcept</code></em></span>
</span></dt><dd><p>Add <code class="code">noexcept</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2187" target="_top">2187</a>:
+ </p></dd><dt><a id="manual.bugs.dr2187"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2187" target="_top">2187</a>:
<span class="emphasis"><em><code class="code">vector&lt;bool&gt;</code> is missing <code class="code">emplace</code> and <code class="code">emplace_back</code> member functions</em></span>
</span></dt><dd><p>Add <code class="code">emplace</code> and <code class="code">emplace_back</code> member functions.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2192" target="_top">2192</a>:
+ </p></dd><dt><a id="manual.bugs.dr2192"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2192" target="_top">2192</a>:
<span class="emphasis"><em>Validity and return type of <code class="code">std::abs(0u)</code> is unclear</em></span>
</span></dt><dd><p>Move all declarations to a common header and remove the
generic <code class="code">abs</code> which accepted unsigned arguments.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2196" target="_top">2196</a>:
+ </p></dd><dt><a id="manual.bugs.dr2196"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2196" target="_top">2196</a>:
<span class="emphasis"><em>Specification of <code class="code">is_*[copy/move]_[constructible/assignable]</code> unclear for non-referencable types</em></span>
</span></dt><dd><p>Use the referenceable type concept.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2212" target="_top">2212</a>:
+ </p></dd><dt><a id="manual.bugs.dr2212"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2212" target="_top">2212</a>:
<span class="emphasis"><em><code class="code">tuple_size</code> for <code class="code">const pair</code> request <code class="code">&lt;tuple&gt;</code> header</em></span>
</span></dt><dd><p>The <code class="code">tuple_size</code> and <code class="code">tuple_element</code>
partial specializations are defined in <code class="code">&lt;utility&gt;</code> which
is included by <code class="code">&lt;array&gt;</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2296" target="_top">2296</a>:
+ </p></dd><dt><a id="manual.bugs.dr2296"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2296" target="_top">2296</a>:
<span class="emphasis"><em><code class="code">std::addressof</code> should be constexpr</em></span>
</span></dt><dd><p>Use <code class="code">__builtin_addressof</code> and add
<code class="code">constexpr</code> to <code class="code">addressof</code> for C++17 and later.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313" target="_top">2313</a>:
+ </p></dd><dt><a id="manual.bugs.dr2313"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2313" target="_top">2313</a>:
<span class="emphasis"><em><code class="code">tuple_size</code> should always derive from <code class="code">integral_constant&lt;size_t, N&gt;</code></em></span>
</span></dt><dd><p>Update definitions of the partial specializations for const and volatile types.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2328" target="_top">2328</a>:
+ </p></dd><dt><a id="manual.bugs.dr2328"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2328" target="_top">2328</a>:
<span class="emphasis"><em>Rvalue stream extraction should use perfect forwarding</em></span>
</span></dt><dd><p>Use perfect forwarding for right operand.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2329" target="_top">2329</a>:
+ </p></dd><dt><a id="manual.bugs.dr2329"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2329" target="_top">2329</a>:
<span class="emphasis"><em><code class="code">regex_match()/regex_search()</code> with <code class="code">match_results</code> should forbid temporary strings</em></span>
</span></dt><dd><p>Add deleted overloads for rvalue strings.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2332" target="_top">2332</a>:
+ </p></dd><dt><a id="manual.bugs.dr2332"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2332" target="_top">2332</a>:
<span class="emphasis"><em><code class="code">regex_iterator/regex_token_iterator</code> should forbid temporary regexes</em></span>
</span></dt><dd><p>Add deleted constructors.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2399" target="_top">2399</a>:
+ </p></dd><dt><a id="manual.bugs.dr2399"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2399" target="_top">2399</a>:
<span class="emphasis"><em><code class="code">shared_ptr</code>'s constructor from <code class="code">unique_ptr</code> should be constrained</em></span>
</span></dt><dd><p>Constrain the constructor to require convertibility.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2400" target="_top">2400</a>:
+ </p></dd><dt><a id="manual.bugs.dr2400"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2400" target="_top">2400</a>:
<span class="emphasis"><em><code class="code">shared_ptr</code>'s <code class="code">get_deleter()</code> should use <code class="code">addressof()</code></em></span>
</span></dt><dd><p>Use <code class="code">addressof</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2401" target="_top">2401</a>:
+ </p></dd><dt><a id="manual.bugs.dr2401"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2401" target="_top">2401</a>:
<span class="emphasis"><em><code class="code">std::function</code> needs more <code class="code">noexcept</code></em></span>
</span></dt><dd><p>Add <code class="code">noexcept</code> to the assignment and comparisons.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2407" target="_top">2407</a>:
+ </p></dd><dt><a id="manual.bugs.dr2407"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2407" target="_top">2407</a>:
<span class="emphasis"><em><code class="code">packaged_task(allocator_arg_t, const Allocator&amp;, F&amp;&amp;)</code>
should neither be constrained nor <code class="code">explicit</code>
</em></span>
</span></dt><dd><p>Remove <code class="code">explicit</code> from the constructor.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2415" target="_top">2415</a>:
+ </p></dd><dt><a id="manual.bugs.dr2415"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2415" target="_top">2415</a>:
<span class="emphasis"><em>Inconsistency between <code class="code">unique_ptr</code> and <code class="code">shared_ptr</code></em></span>
</span></dt><dd><p>Create empty an <code class="code">shared_ptr</code> from an empty
<code class="code">unique_ptr</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2418" target="_top">2418</a>:
+ </p></dd><dt><a id="manual.bugs.dr2418"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2418" target="_top">2418</a>:
<span class="emphasis"><em><code class="code">apply</code> does not work with member pointers</em></span>
</span></dt><dd><p>Use <code class="code">mem_fn</code> for member pointers.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2440" target="_top">2440</a>:
+ </p></dd><dt><a id="manual.bugs.dr2440"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2440" target="_top">2440</a>:
<span class="emphasis"><em><code class="code">seed_seq::size()</code> should be <code class="code">noexcept</code></em></span>
</span></dt><dd><p>Add <code class="code">noexcept</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2441" target="_top">2441</a>:
+ </p></dd><dt><a id="manual.bugs.dr2441"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2441" target="_top">2441</a>:
<span class="emphasis"><em>Exact-width atomic typedefs should be provided</em></span>
</span></dt><dd><p>Define the typedefs.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2442" target="_top">2442</a>:
+ </p></dd><dt><a id="manual.bugs.dr2442"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2442" target="_top">2442</a>:
<span class="emphasis"><em><code class="code">call_once()</code> shouldn't <code class="code">DECAY_COPY()</code></em></span>
</span></dt><dd><p>Remove indirection through call wrapper that made copies
of arguments and forward arguments straight to <code class="code">std::invoke</code>.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2454" target="_top">2454</a>:
+ </p></dd><dt><a id="manual.bugs.dr2454"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2454" target="_top">2454</a>:
<span class="emphasis"><em>Add <code class="code">raw_storage_iterator::base()</code> member
</em></span>
</span></dt><dd><p>Add the <code class="code">base()</code> member function.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2455" target="_top">2455</a>:
+ </p></dd><dt><a id="manual.bugs.dr2455"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2455" target="_top">2455</a>:
<span class="emphasis"><em>Allocator default construction should be allowed to throw
</em></span>
</span></dt><dd><p>Make <code class="code">noexcept</code> specifications conditional.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2458" target="_top">2458</a>:
+ </p></dd><dt><a id="manual.bugs.dr2458"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2458" target="_top">2458</a>:
<span class="emphasis"><em>N3778 and new library deallocation signatures
</em></span>
</span></dt><dd><p>Remove unused overloads.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2459" target="_top">2459</a>:
+ </p></dd><dt><a id="manual.bugs.dr2459"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2459" target="_top">2459</a>:
<span class="emphasis"><em><code class="code">std::polar</code> should require a non-negative rho
</em></span>
</span></dt><dd><p>Add debug mode assertion.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2466" target="_top">2466</a>:
+ </p></dd><dt><a id="manual.bugs.dr2466"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2466" target="_top">2466</a>:
<span class="emphasis"><em><code class="code">allocator_traits::max_size()</code> default behavior is incorrect
</em></span>
</span></dt><dd><p>Divide by the object type.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2484" target="_top">2484</a>:
+ </p></dd><dt><a id="manual.bugs.dr2484"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2484" target="_top">2484</a>:
<span class="emphasis"><em><code class="code">rethrow_if_nested()</code> is doubly unimplementable
</em></span>
</span></dt><dd><p>Avoid using <code class="code">dynamic_cast</code> when it would be
ill-formed.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2583" target="_top">2583</a>:
+ </p></dd><dt><a id="manual.bugs.dr2583"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2583" target="_top">2583</a>:
<span class="emphasis"><em>There is no way to supply an allocator for <code class="code">basic_string(str, pos)</code>
</em></span>
</span></dt><dd><p>Add new constructor
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2684" target="_top">2684</a>:
+ </p></dd><dt><a id="manual.bugs.dr2684"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2684" target="_top">2684</a>:
<span class="emphasis"><em><code class="code">priority_queue</code> lacking comparator typedef
</em></span>
</span></dt><dd><p>Define the <code class="code">value_compare</code> typedef.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2770" target="_top">2770</a>:
+ </p></dd><dt><a id="manual.bugs.dr2770"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2770" target="_top">2770</a>:
<span class="emphasis"><em><code class="code">tuple_size&lt;const T&gt;</code> specialization is not
SFINAE compatible and breaks decomposition declarations
</em></span>
</span></dt><dd><p>Safely detect <code class="code">tuple_size&lt;T&gt;::value</code> and
only use it if valid.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2781" target="_top">2781</a>:
+ </p></dd><dt><a id="manual.bugs.dr2781"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2781" target="_top">2781</a>:
<span class="emphasis"><em>Contradictory requirements for <code class="code">std::function</code>
and <code class="code">std::reference_wrapper</code>
</em></span>
</span></dt><dd><p>Remove special handling for <code class="code">reference_wrapper</code>
arguments and store them directly as the target object.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2802" target="_top">2802</a>:
+ </p></dd><dt><a id="manual.bugs.dr2802"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2802" target="_top">2802</a>:
<span class="emphasis"><em>Add noexcept to several <code class="code">shared_ptr</code> related
functions
</em></span>
</span></dt><dd><p>Add noexcept.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2873" target="_top">2873</a>:
+ </p></dd><dt><a id="manual.bugs.dr2873"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2873" target="_top">2873</a>:
<span class="emphasis"><em><code class="code">shared_ptr</code> constructor requirements for a deleter
</em></span>
</span></dt><dd><p>Use rvalues for deleters.
- </p></dd><dt><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2942" target="_top">2942</a>:
+ </p></dd><dt><a id="manual.bugs.dr2942"></a><span class="term"><a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2942" target="_top">2942</a>:
<span class="emphasis"><em>LWG 2873's resolution missed
<code class="code">weak_ptr::owner_before</code>
</em></span>
diff --git a/libstdc++-v3/doc/html/manual/test.html b/libstdc++-v3/doc/html/manual/test.html
index 70341779ca7..f19a8e82a2c 100644
--- a/libstdc++-v3/doc/html/manual/test.html
+++ b/libstdc++-v3/doc/html/manual/test.html
@@ -327,13 +327,13 @@ cat 27_io/objects/char/3_xin.in | a.out</pre></dd><dt><span class="term"><code c
For example, to run the tests with
<code class="option">-O1 -D_GLIBCXX_ASSERTIONS</code>
you could use:
-</p><pre class="programlisting"> make RUNTESTFLAGS=--target_board=unix/-O1/-D_GLIBCXX_ASSERTIONS</pre><p>
+</p><pre class="programlisting"> make check RUNTESTFLAGS=--target_board=unix/-O1/-D_GLIBCXX_ASSERTIONS</pre><p>
</p><p>
The <code class="option">--target_board</code> option can also be used to run the
tests multiple times in different variations. For example, to run the
entire testsuite three times using <code class="option">-O3</code> but with
different <code class="option">-std</code> options:
-</p><pre class="programlisting"> make 'RUNTESTFLAGS=--target_board=unix/-O3\"{-std=gnu++98,-std=gnu++11,-std=gnu++14}\"'</pre><p>
+</p><pre class="programlisting"> make check 'RUNTESTFLAGS=--target_board=unix/-O3\"{-std=gnu++98,-std=gnu++11,-std=gnu++14}\"'</pre><p>
N.B. that set of variations could also be written as
<code class="literal">unix/-O3\"{-std=gnu++98,-std=gnu++11,}\"</code> so that
the third variation would use the default for <code class="option">-std</code>
diff --git a/libstdc++-v3/doc/xml/faq.xml b/libstdc++-v3/doc/xml/faq.xml
index 8041c1428e6..703ade5b20d 100644
--- a/libstdc++-v3/doc/xml/faq.xml
+++ b/libstdc++-v3/doc/xml/faq.xml
@@ -66,10 +66,10 @@
that are the hallmarks of an open-source project are applied to libstdc++.
</para>
<para>
- All of the standard classes and functions from C++98/C++03
+ All of the standard classes and functions from C++98/C++03, C++11 and C++14
(such as <classname>string</classname>,
<classname>vector&lt;&gt;</classname>, iostreams, algorithms etc.)
- are freely available and atempt to be fully compliant.
+ are freely available and attempt to be fully compliant.
Work is ongoing to complete support for the current revision of the
ISO C++ Standard.
</para>
@@ -539,6 +539,9 @@
</para>
</question>
<answer xml:id="a-solaris_long_long">
+ <note>
+ <para>This answer is old and probably no longer be relevant.</para>
+ </note>
<para>
By default we try to support the C99 <type>long long</type> type.
This requires that certain functions from your C library be present.
@@ -692,7 +695,7 @@
<qandaentry xml:id="faq.freebsd_wchar">
<question xml:id="q-freebsd_wchar">
<para>
- Can't use wchar_t/wstring on FreeBSD
+ Can't use <type>wchar_t</type>/<classname>wstring</classname> on FreeBSD
</para>
</question>
<answer xml:id="a-freebsd_wchar">
@@ -764,7 +767,8 @@
published on <link xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:href="http://www.open-std.org/jtc1/sc22/wg21/">the WG21
website</link>.
- Many of these issues have resulted in code changes in libstdc++.
+ Many of these issues have resulted in
+ <link linkend="manual.intro.status.bugs.iso">code changes in libstdc++</link>.
</para>
<para>
If you think you've discovered a new bug that is not listed,
@@ -794,8 +798,8 @@
</para>
<para>
Before reporting a bug, please examine the
- <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/bugs/">bugs database</link> with the
- category set to <quote>g++</quote>.
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://gcc.gnu.org/bugs/">bugs database</link>, with the
+ component set to <quote>c++</quote>.
</para>
</answer>
</qandaentry>
@@ -813,8 +817,12 @@
</para>
</question>
<answer xml:id="a-stream_reopening_fails">
+ <note>
+ <para>This answer is old and probably no longer be relevant.</para>
+ </note>
<para>
- One of the most-reported non-bug reports. Executing a sequence like:
+ Prior to GCC 4.0 this was one of the most-reported non-bug reports.
+ Executing a sequence like this would fail:
</para>
<programlisting>
@@ -829,19 +837,20 @@
</programlisting>
<para>
- All operations on the re-opened <varname>fs</varname> will fail, or at
- least act very strangely. Yes, they often will, especially if
- <varname>fs</varname> reached the EOF state on the previous file. The
- reason is that the state flags are <emphasis>not</emphasis> cleared
- on a successful call to open(). The standard unfortunately did
- not specify behavior in this case, and to everybody's great sorrow,
- the <link linkend="manual.intro.status.bugs">proposed LWG resolution in
- DR #22</link> is to leave the flags unchanged. You must insert a call
- to <function>fs.clear()</function> between the calls to close() and open(),
- and then everything will work like we all expect it to work.
- <emphasis>Update:</emphasis> for GCC 4.0 we implemented the resolution
- of <link linkend="manual.intro.status.bugs">DR #409</link> and open()
- now calls <function>clear()</function> on success!
+ All operations on the re-opened <varname>fs</varname> would fail, or at
+ least act very strangely, especially if <varname>fs</varname> reached the
+ EOF state on the previous file.
+ The original C++98 standard did not specify behavior in this case, and
+ the <link linkend="manual.bugs.dr22">resolution of DR #22</link> was to
+ leave the state flags unchanged on a successful call to
+ <function>open()</function>.
+ You had to insert a call to <function>fs.clear()</function> between the
+ calls to <function>close()</function> and <function>open()</function>,
+ and then everything will work as expected.
+ <emphasis>Update:</emphasis> For GCC 4.0 we implemented the resolution
+ of <link linkend="manual.bugs.dr409">DR #409</link> and
+ <function>open()</function>
+ now calls <function>clear()</function> on success.
</para>
</answer>
</qandaentry>
@@ -858,7 +867,9 @@
libstdc++ <option>-Weffc++</option>-clean is not a goal of the project,
for a few reasons. Mainly, that option tries to enforce
object-oriented programming, while the Standard Library isn't
- necessarily trying to be OO.
+ necessarily trying to be OO. The option also enforces outdated guidelines
+ from old editions of the books, and the advice isn't all relevant to
+ modern C++ (especially C++11 and later).
</para>
<para>
We do, however, try to have libstdc++ sources as clean as possible. If
@@ -879,9 +890,10 @@
Another problem is the <literal>rel_ops</literal> namespace and the template
comparison operator functions contained therein. If they become
visible in the same namespace as other comparison functions
- (e.g., <quote>using</quote> them and the &lt;iterator&gt; header),
+ (e.g., <quote>using</quote> them and the
+ <filename class="headerfile">&lt;iterator&gt;</filename> header),
then you will suddenly be faced with huge numbers of ambiguity
- errors. This was discussed on the -v3 list; Nathan Myers
+ errors. This was discussed on the mailing list; Nathan Myers
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html">sums
things up here</link>. The collisions with vector/string iterator
types have been fixed for 3.1.
@@ -896,6 +908,9 @@
</para>
</question>
<answer xml:id="a-v2_headers">
+ <note>
+ <para>This answer is old and probably no longer be relevant.</para>
+ </note>
<para>
If you are using headers in
<filename class="directory">${prefix}/include/g++-3</filename>, or if
@@ -981,11 +996,15 @@
</para>
</question>
<answer xml:id="a-memory_leaks">
+ <note>
+ <para>This answer is old and probably no longer be relevant.</para>
+ </note>
<para>
A few people have reported that the standard containers appear
to leak memory when tested with memory checkers such as
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://valgrind.org/"><command>valgrind</command></link>.
- Under some configurations the library's allocators keep free memory in a
+ Under some (non-default) configurations the library's allocators keep
+ free memory in a
pool for later reuse, rather than returning it to the OS. Although
this memory is always reachable by the library and is never
lost, memory debugging tools can report it as a leak. If you
@@ -999,7 +1018,7 @@
<qandaentry xml:id="faq.list_size_on">
<question xml:id="q-list_size_on">
<para>
- list::size() is O(n)!
+ <code>list::size()</code> is O(n)!
</para>
</question>
<answer xml:id="a-list_size_on">
@@ -1049,7 +1068,8 @@
<qandaentry xml:id="faq.iterator_as_pod">
<question xml:id="faq.iterator_as_pod_q">
<para>
- string::iterator is not char*; vector&lt;T&gt;::iterator is not T*
+ <classname>string::iterator</classname> is not <code>char*</code>;
+ <classname>vector&lt;T&gt;::iterator</classname> is not <code>T*</code>
</para>
</question>
<answer xml:id="faq.iterator_as_pod_a">
@@ -1067,11 +1087,9 @@
arguments.
</para>
<para>
- Code which does assume that a vector iterator <varname>i</varname>
+ Code which does assume that a vector/string iterator <varname>i</varname>
is a pointer can often be fixed by changing <varname>i</varname> in
- certain expressions to <varname>&amp;*i</varname>. Future revisions
- of the Standard are expected to bless this usage for
- vector&lt;&gt; (but not for basic_string&lt;&gt;).
+ certain expressions to <varname>&amp;*i</varname>.
</para>
</answer>
</qandaentry>
@@ -1084,17 +1102,10 @@
</question>
<answer xml:id="a-what_is_next">
<para>
- Hopefully, not much. The goal of libstdc++ is to produce a
- fully-compliant, fully-portable Standard Library. After that,
- we're mostly done: there won't <emphasis>be</emphasis> any
- more compliance work to do.
- </para>
- <para>
- There is an effort underway to add significant extensions to
- the standard library specification. The latest version of
- this effort is described in
- <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf">
- The C++ Library Technical Report 1</link>.
+ The goal of libstdc++ is to produce a
+ fully-compliant, fully-portable Standard Library.
+ While the C++ Standard continues to evolve the libstdc++ will
+ continue to track it.
</para>
</answer>
</qandaentry>
@@ -1107,18 +1118,27 @@
</question>
<answer xml:id="a-sgi_stl">
<para>
- The <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/">STL from SGI</link>,
- version 3.3, was the final merge of the STL codebase. The
- code in libstdc++ contains many fixes and changes, and
- the SGI code is no longer under active
- development. We expect that no future merges will take place.
+ The STL (Standard Template Library) was the inspiration for large chunks
+ of the C++ Standard Library, but the terms are not interchangeable and
+ they don't mean the same thing. The C++ Standard Library includes lots of
+ things that didn't come from the STL, and some of them aren't even
+ templates, such as <classname>std::locale</classname> and
+ <classname>std::thread</classname>.
+ </para>
+ <para>
+ Libstdc++-v3 incorporates a lot of code from
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/">the SGI STL</link>
+ (the final merge was from
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.sgi.com/tech/stl/whats_new.html">release 3.3</link>).
+ The code in libstdc++ contains many fixes and changes compared to the
+ original SGI code.
</para>
<para>
In particular, <classname>string</classname> is not from SGI and makes no
- use of their "rope" class (which is included as an
- optional extension), nor is <classname>valarray</classname> and some others.
- Classes like <classname>vector&lt;&gt;</classname> are, but have been
- extensively modified.
+ use of their "rope" class (although that is included as an optional
+ extension), neither is <classname>valarray</classname> nor some others.
+ Classes like <classname>vector&lt;&gt;</classname> were from SGI, but have
+ been extensively modified.
</para>
<para>
More information on the evolution of libstdc++ can be found at the
@@ -1158,14 +1178,19 @@
Yes.
</para>
<para>
- The C++ Standard Library Technical Report adds many new features to
- the library. The latest version of this effort is described in
+ The C++ Standard Library
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1836.pdf">
- Technical Report 1</link>.
+ Technical Report 1</link> added many new features to the library.
</para>
<para>
- The implementation status of TR1 in libstdc++ can be tracked <link linkend="status.iso.tr1">on the TR1 status
- page</link>.
+ The implementation status of TR1 in libstdc++ can be tracked
+ <link linkend="status.iso.tr1">on the TR1 status page</link>.
+ </para>
+ <para>
+ New code should probably not use TR1, because almost everything in it has
+ been added to the main C++ Standard Library (usually with significant
+ improvements).
+ The TR1 implementation in libstdc++ is no longer actively maintained.
</para>
</answer>
</qandaentry>
@@ -1252,13 +1277,18 @@
<qandaentry xml:id="faq.size_equals_capacity">
<question xml:id="q-size_equals_capacity">
<para>
- How do I make std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size?
+ How do I make <code>std::vector&lt;T&gt;::capacity() == std::vector&lt;T&gt;::size</code>?
</para>
</question>
<answer xml:id="a-size_equals_capacity">
<para>
- The standard idiom for deallocating a <classname>vector&lt;T&gt;</classname>'s
- unused memory is to create a temporary copy of the vector and swap their
+ Since C++11 just call the <function>shrink_to_fit()</function> member
+ function.
+ </para>
+ <para>
+ Before C++11, the standard idiom for deallocating a
+ <classname>vector&lt;T&gt;</classname>'s
+ unused memory was to create a temporary copy of the vector and swap their
contents, e.g. for <classname>vector&lt;T&gt; v</classname>
</para>
<literallayout class="normal">
diff --git a/libstdc++-v3/doc/xml/manual/intro.xml b/libstdc++-v3/doc/xml/manual/intro.xml
index 4ec74949bfb..782817e0698 100644
--- a/libstdc++-v3/doc/xml/manual/intro.xml
+++ b/libstdc++-v3/doc/xml/manual/intro.xml
@@ -193,8 +193,8 @@ requirements of the license of GCC.
<para>
Information on known bugs, details on efforts to fix them, and
- fixed bugs are all available as part of the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/bugs/">GCC bug tracking system</link>,
- with the category set to <literal>libstdc++</literal>.
+ fixed bugs are all available as part of the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://gcc.gnu.org/bugs/">GCC bug tracking system</link>,
+ under the component <quote>libstdc++</quote>.
</para>
</section>
@@ -211,71 +211,73 @@ requirements of the license of GCC.
</para>
<para>
Here are the issues which have resulted in code changes to the library.
- The links are to the specific defect reports from a <emphasis>partial
- copy</emphasis> of the Issues List. You can read the full version online
+ The links are to the full version of the Issues List.
+ You can read the full version online
at the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/">ISO C++
Committee homepage</link>.
</para>
<para>
If a DR is not listed here, we may simply not have gotten to
- it yet; feel free to submit a patch. Search the include/bits
- and src directories for appearances of
+ it yet; feel free to submit a patch. Search the
+ <filename class="directory">include</filename> and
+ <filename class="directory">src</filename>
+ directories for appearances of
<constant>_GLIBCXX_RESOLVE_LIB_DEFECTS</constant> for examples
of style. Note that we usually do not make changes to the
code until an issue has reached <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#DR">DR</link> status.
</para>
<variablelist>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#5">5</link>:
+ <varlistentry xml:id="manual.bugs.dr5"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#5">5</link>:
<emphasis>string::compare specification questionable</emphasis>
</term>
<listitem><para>This should be two overloaded functions rather than a single function.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#17">17</link>:
+ <varlistentry xml:id="manual.bugs.dr17"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#17">17</link>:
<emphasis>Bad bool parsing</emphasis>
</term>
<listitem><para>Apparently extracting Boolean values was messed up...
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#19">19</link>:
+ <varlistentry xml:id="manual.bugs.dr19"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#19">19</link>:
<emphasis>"Noconv" definition too vague</emphasis>
</term>
<listitem><para>If <code>codecvt::do_in</code> returns <code>noconv</code> there are
no changes to the values in <code>[to, to_limit)</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#22">22</link>:
+ <varlistentry xml:id="manual.bugs.dr22"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#22">22</link>:
<emphasis>Member open vs flags</emphasis>
</term>
<listitem><para>Re-opening a file stream does <emphasis>not</emphasis> clear the state flags.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#23">23</link>:
+ <varlistentry xml:id="manual.bugs.dr23"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#23">23</link>:
<emphasis>Num_get overflow result</emphasis>
</term>
<listitem><para>Implement the proposed resolution.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#25">25</link>:
+ <varlistentry xml:id="manual.bugs.dr25"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#25">25</link>:
<emphasis>String operator&lt;&lt; uses width() value wrong</emphasis>
</term>
<listitem><para>Padding issues.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#48">48</link>:
+ <varlistentry xml:id="manual.bugs.dr48"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#48">48</link>:
<emphasis>Use of non-existent exception constructor</emphasis>
</term>
<listitem><para>An instance of <code>ios_base::failure</code> is constructed instead.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#49">49</link>:
+ <varlistentry xml:id="manual.bugs.dr49"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#49">49</link>:
<emphasis>Underspecification of ios_base::sync_with_stdio</emphasis>
</term>
<listitem><para>The return type is the <emphasis>previous</emphasis> state of synchronization.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#50">50</link>:
+ <varlistentry xml:id="manual.bugs.dr50"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#50">50</link>:
<emphasis>Copy constructor and assignment operator of ios_base</emphasis>
</term>
<listitem><para>These members functions are declared <code>private</code> and are
@@ -283,55 +285,55 @@ requirements of the license of GCC.
"copying stream state" was deemed too complicated.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#60">60</link>:
+ <varlistentry xml:id="manual.bugs.dr60"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#60">60</link>:
<emphasis>What is a formatted input function?</emphasis>
</term>
<listitem><para>This DR made many widespread changes to <code>basic_istream</code>
and <code>basic_ostream</code> all of which have been implemented.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#63">63</link>:
+ <varlistentry xml:id="manual.bugs.dr63"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#63">63</link>:
<emphasis>Exception-handling policy for unformatted output</emphasis>
</term>
<listitem><para>Make the policy consistent with that of formatted input, unformatted
input, and formatted output.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#68">68</link>:
+ <varlistentry xml:id="manual.bugs.dr68"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#68">68</link>:
<emphasis>Extractors for char* should store null at end</emphasis>
</term>
<listitem><para>And they do now. An editing glitch in the last item in the list of
[27.6.1.2.3]/7.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#74">74</link>:
+ <varlistentry xml:id="manual.bugs.dr74"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#74">74</link>:
<emphasis>Garbled text for codecvt::do_max_length</emphasis>
</term>
<listitem><para>The text of the standard was gibberish. Typos gone rampant.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#75">75</link>:
+ <varlistentry xml:id="manual.bugs.dr75"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#75">75</link>:
<emphasis>Contradiction in codecvt::length's argument types</emphasis>
</term>
<listitem><para>Change the first parameter to <code>stateT&amp;</code> and implement
the new effects paragraph.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#83">83</link>:
+ <varlistentry xml:id="manual.bugs.dr83"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#83">83</link>:
<emphasis>string::npos vs. string::max_size()</emphasis>
</term>
<listitem><para>Safety checks on the size of the string should test against
<code>max_size()</code> rather than <code>npos</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#90">90</link>:
+ <varlistentry xml:id="manual.bugs.dr90"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#90">90</link>:
<emphasis>Incorrect description of operator&gt;&gt; for strings</emphasis>
</term>
<listitem><para>The effect contain <code>isspace(c,getloc())</code> which must be
replaced by <code>isspace(c,is.getloc())</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#91">91</link>:
+ <varlistentry xml:id="manual.bugs.dr91"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#91">91</link>:
<emphasis>Description of operator&gt;&gt; and getline() for string&lt;&gt;
might cause endless loop</emphasis>
</term>
@@ -340,7 +342,7 @@ requirements of the license of GCC.
not required to set <code>gcount</code>).
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#103">103</link>:
+ <varlistentry xml:id="manual.bugs.dr103"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#103">103</link>:
<emphasis>set::iterator is required to be modifiable, but this allows
modification of keys.</emphasis>
</term>
@@ -349,14 +351,14 @@ requirements of the license of GCC.
</code> are constant iterators.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#109">109</link>:
+ <varlistentry xml:id="manual.bugs.dr109"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#109">109</link>:
<emphasis>Missing binders for non-const sequence elements</emphasis>
</term>
<listitem><para>The <code>binder1st</code> and <code>binder2nd</code> didn't have an
<code>operator()</code> taking a non-const parameter.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#110">110</link>:
+ <varlistentry xml:id="manual.bugs.dr110"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#110">110</link>:
<emphasis>istreambuf_iterator::equal not const</emphasis>
</term>
<listitem><para>This was not a const member function. Note that the DR says to
@@ -364,31 +366,31 @@ requirements of the license of GCC.
overloaded version with identical contents.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#117">117</link>:
+ <varlistentry xml:id="manual.bugs.dr117"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#117">117</link>:
<emphasis>basic_ostream uses nonexistent num_put member functions</emphasis>
</term>
<listitem><para><code>num_put::put()</code> was overloaded on the wrong types.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#118">118</link>:
+ <varlistentry xml:id="manual.bugs.dr118"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#118">118</link>:
<emphasis>basic_istream uses nonexistent num_get member functions</emphasis>
</term>
<listitem><para>Same as 117, but for <code>num_get::get()</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#129">129</link>:
+ <varlistentry xml:id="manual.bugs.dr129"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#129">129</link>:
<emphasis>Need error indication from seekp() and seekg()</emphasis>
</term>
<listitem><para>These functions set <code>failbit</code> on error now.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#130">130</link>:
+ <varlistentry xml:id="manual.bugs.dr130"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#130">130</link>:
<emphasis>Return type of container::erase(iterator) differs for associative containers</emphasis>
</term>
<listitem><para>Make member <code>erase</code> return iterator for <code>set</code>, <code>multiset</code>, <code>map</code>, <code>multimap</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#136">136</link>:
+ <varlistentry xml:id="manual.bugs.dr136"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#136">136</link>:
<emphasis>seekp, seekg setting wrong streams?</emphasis>
</term>
<listitem><para><code>seekp</code> should only set the output stream, and
@@ -402,46 +404,46 @@ requirements of the license of GCC.
should probably not be calling <code>underflow()</code>.
</para></listitem></varlistentry> -->
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#167">167</link>:
+ <varlistentry xml:id="manual.bugs.dr167"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#167">167</link>:
<emphasis>Improper use of traits_type::length()</emphasis>
</term>
<listitem><para><code>op&lt;&lt;</code> with a <code>const char*</code> was
calculating an incorrect number of characters to write.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#169">169</link>:
+ <varlistentry xml:id="manual.bugs.dr169"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#169">169</link>:
<emphasis>Bad efficiency of overflow() mandated</emphasis>
</term>
<listitem><para>Grow efficiently the internal array object.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#171">171</link>:
+ <varlistentry xml:id="manual.bugs.dr171"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#171">171</link>:
<emphasis>Strange seekpos() semantics due to joint position</emphasis>
</term>
<listitem><para>Quite complex to summarize...
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#181">181</link>:
+ <varlistentry xml:id="manual.bugs.dr181"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#181">181</link>:
<emphasis>make_pair() unintended behavior</emphasis>
</term>
<listitem><para>This function used to take its arguments as reference-to-const, now
it copies them (pass by value).
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#195">195</link>:
+ <varlistentry xml:id="manual.bugs.dr195"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#195">195</link>:
<emphasis>Should basic_istream::sentry's constructor ever set eofbit?</emphasis>
</term>
<listitem><para>Yes, it can, specifically if EOF is reached while skipping whitespace.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#211">211</link>:
+ <varlistentry xml:id="manual.bugs.dr211"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#211">211</link>:
<emphasis>operator&gt;&gt;(istream&amp;, string&amp;) doesn't set failbit</emphasis>
</term>
<listitem><para>If nothing is extracted into the string, <code>op&gt;&gt;</code> now
sets <code>failbit</code> (which can cause an exception, etc., etc.).
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#214">214</link>:
+ <varlistentry xml:id="manual.bugs.dr214"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#214">214</link>:
<emphasis>set::find() missing const overload</emphasis>
</term>
<listitem><para>Both <code>set</code> and <code>multiset</code> were missing
@@ -449,47 +451,47 @@ requirements of the license of GCC.
for const instances.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#231">231</link>:
+ <varlistentry xml:id="manual.bugs.dr231"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#231">231</link>:
<emphasis>Precision in iostream?</emphasis>
</term>
<listitem><para>For conversion from a floating-point type, <code>str.precision()</code>
is specified in the conversion specification.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#233">233</link>:
+ <varlistentry xml:id="manual.bugs.dr233"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#233">233</link>:
<emphasis>Insertion hints in associative containers</emphasis>
</term>
<listitem><para>Implement N1780, first check before then check after, insert as close
to hint as possible.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#235">235</link>:
+ <varlistentry xml:id="manual.bugs.dr235"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#235">235</link>:
<emphasis>No specification of default ctor for reverse_iterator</emphasis>
</term>
<listitem><para>The declaration of <code>reverse_iterator</code> lists a default constructor.
However, no specification is given what this constructor should do.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#241">241</link>:
+ <varlistentry xml:id="manual.bugs.dr241"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#241">241</link>:
<emphasis>Does unique_copy() require CopyConstructible and Assignable?</emphasis>
</term>
<listitem><para>Add a helper for forward_iterator/output_iterator, fix the existing
one for input_iterator/output_iterator to not rely on Assignability.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#243">243</link>:
+ <varlistentry xml:id="manual.bugs.dr243"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#243">243</link>:
<emphasis>get and getline when sentry reports failure</emphasis>
</term>
<listitem><para>Store a null character only if the character array has a non-zero size.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#251">251</link>:
+ <varlistentry xml:id="manual.bugs.dr251"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#251">251</link>:
<emphasis>basic_stringbuf missing allocator_type</emphasis>
</term>
<listitem><para>This nested typedef was originally not specified.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#253">253</link>:
+ <varlistentry xml:id="manual.bugs.dr253"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#253">253</link>:
<emphasis>valarray helper functions are almost entirely useless</emphasis>
</term>
<listitem><para>Make the copy constructor and copy-assignment operator declarations
@@ -497,60 +499,60 @@ requirements of the license of GCC.
definitions.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#265">265</link>:
+ <varlistentry xml:id="manual.bugs.dr265"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#265">265</link>:
<emphasis>std::pair::pair() effects overly restrictive</emphasis>
</term>
<listitem><para>The default ctor would build its members from copies of temporaries;
now it simply uses their respective default ctors.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#266">266</link>:
+ <varlistentry xml:id="manual.bugs.dr266"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#266">266</link>:
<emphasis>bad_exception::~bad_exception() missing Effects clause</emphasis>
</term>
<listitem><para>The <code>bad_</code>* classes no longer have destructors (they
are trivial), since no description of them was ever given.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#271">271</link>:
+ <varlistentry xml:id="manual.bugs.dr271"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#271">271</link>:
<emphasis>basic_iostream missing typedefs</emphasis>
</term>
<listitem><para>The typedefs it inherits from its base classes can't be used, since
(for example) <code>basic_iostream&lt;T&gt;::traits_type</code> is ambiguous.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#275">275</link>:
+ <varlistentry xml:id="manual.bugs.dr275"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#275">275</link>:
<emphasis>Wrong type in num_get::get() overloads</emphasis>
</term>
<listitem><para>Similar to 118.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#280">280</link>:
+ <varlistentry xml:id="manual.bugs.dr280"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#280">280</link>:
<emphasis>Comparison of reverse_iterator to const reverse_iterator</emphasis>
</term>
<listitem><para>Add global functions with two template parameters.
(NB: not added for now a templated assignment operator)
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#292">292</link>:
+ <varlistentry xml:id="manual.bugs.dr292"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#292">292</link>:
<emphasis>Effects of a.copyfmt (a)</emphasis>
</term>
<listitem><para>If <code>(this == &amp;rhs)</code> do nothing.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#300">300</link>:
+ <varlistentry xml:id="manual.bugs.dr300"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#300">300</link>:
<emphasis>List::merge() specification incomplete</emphasis>
</term>
<listitem><para>If <code>(this == &amp;x)</code> do nothing.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#303">303</link>:
+ <varlistentry xml:id="manual.bugs.dr303"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#303">303</link>:
<emphasis>Bitset input operator underspecified</emphasis>
</term>
<listitem><para>Basically, compare the input character to
<code>is.widen(0)</code> and <code>is.widen(1)</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#305">305</link>:
+ <varlistentry xml:id="manual.bugs.dr305"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#305">305</link>:
<emphasis>Default behavior of codecvt&lt;wchar_t, char,
mbstate_t&gt;::length()</emphasis>
</term>
@@ -558,20 +560,20 @@ requirements of the license of GCC.
mbstate_t&gt;::do_length</code> must return.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#328">328</link>:
+ <varlistentry xml:id="manual.bugs.dr328"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#328">328</link>:
<emphasis>Bad sprintf format modifier in
money_put&lt;&gt;::do_put()</emphasis>
</term>
<listitem><para>Change the format string to "%.0Lf".
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#365">365</link>:
+ <varlistentry xml:id="manual.bugs.dr365"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#365">365</link>:
<emphasis>Lack of const-qualification in clause 27</emphasis>
</term>
<listitem><para>Add const overloads of <code>is_open</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#387">387</link>:
+ <varlistentry xml:id="manual.bugs.dr387"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#387">387</link>:
<emphasis>std::complex over-encapsulated</emphasis>
</term>
<listitem><para>Add the <code>real(T)</code> and <code>imag(T)</code>
@@ -580,20 +582,20 @@ requirements of the license of GCC.
free functions.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#389">389</link>:
+ <varlistentry xml:id="manual.bugs.dr389"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#389">389</link>:
<emphasis>Const overload of valarray::operator[] returns
by value</emphasis>
</term>
<listitem><para>Change it to return a <code>const T&amp;</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#396">396</link>:
+ <varlistentry xml:id="manual.bugs.dr396"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#396">396</link>:
<emphasis>what are characters zero and one</emphasis>
</term>
<listitem><para>Implement the proposed resolution.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#402">402</link>:
+ <varlistentry xml:id="manual.bugs.dr402"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#402">402</link>:
<emphasis>Wrong new expression in [some_]allocator::construct</emphasis>
</term>
<listitem><para>Replace "new" with "::new".
@@ -607,7 +609,7 @@ requirements of the license of GCC.
<listitem><para>Tweak the debug-mode checks in _Safe_iterator.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#409">409</link>:
+ <varlistentry xml:id="manual.bugs.dr409"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#409">409</link>:
<emphasis>Closing an fstream should clear the error state</emphasis>
</term>
<listitem><para>Have <code>open</code> clear the error flags.
@@ -619,57 +621,57 @@ requirements of the license of GCC.
<listitem><para>Implement Option 3, as per N1599.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#432">432</link>:
+ <varlistentry xml:id="manual.bugs.dr432"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#432">432</link>:
<emphasis>stringbuf::overflow() makes only one write position
available</emphasis>
</term>
<listitem><para>Implement the resolution, beyond DR 169.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#434">434</link>:
+ <varlistentry xml:id="manual.bugs.dr434"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#434">434</link>:
<emphasis>bitset::to_string() hard to use</emphasis>
</term>
<listitem><para>Add three overloads, taking fewer template arguments.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#438">438</link>:
+ <varlistentry xml:id="manual.bugs.dr438"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#438">438</link>:
<emphasis>Ambiguity in the "do the right thing" clause</emphasis>
</term>
<listitem><para>Implement the resolution, basically cast less.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#445">445</link>:
+ <varlistentry xml:id="manual.bugs.dr445"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#445">445</link>:
<emphasis>iterator_traits::reference unspecified for some iterator categories</emphasis>
</term>
<listitem><para>Change <code>istreambuf_iterator::reference</code> in C++11 mode.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#453">453</link>:
+ <varlistentry xml:id="manual.bugs.dr453"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#453">453</link>:
<emphasis>basic_stringbuf::seekoff need not always fail for an empty stream</emphasis>
</term>
<listitem><para>Don't fail if the next pointer is null and newoff is zero.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#455">455</link>:
+ <varlistentry xml:id="manual.bugs.dr455"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#455">455</link>:
<emphasis>cerr::tie() and wcerr::tie() are overspecified</emphasis>
</term>
<listitem><para>Initialize cerr tied to cout and wcerr tied to wcout.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#464">464</link>:
+ <varlistentry xml:id="manual.bugs.dr464"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#464">464</link>:
<emphasis>Suggestion for new member functions in standard containers</emphasis>
</term>
<listitem><para>Add <code>data()</code> to <code>std::vector</code> and
<code>at(const key_type&amp;)</code> to <code>std::map</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#467">467</link>:
+ <varlistentry xml:id="manual.bugs.dr467"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#467">467</link>:
<emphasis>char_traits::lt(), compare(), and memcmp()</emphasis>
</term>
<listitem><para>Change <code>lt</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#508">508</link>:
+ <varlistentry xml:id="manual.bugs.dr508"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#508">508</link>:
<emphasis>Bad parameters for ranlux64_base_01</emphasis>
</term>
<listitem><para>Fix the parameters.
@@ -688,7 +690,7 @@ requirements of the license of GCC.
<listitem><para>Use &amp;value.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#538">538</link>:
+ <varlistentry xml:id="manual.bugs.dr538"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#538">538</link>:
<emphasis>241 again: Does unique_copy() require CopyConstructible
and Assignable?</emphasis>
</term>
@@ -696,7 +698,7 @@ requirements of the license of GCC.
input_iterator' value_type.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#539">539</link>:
+ <varlistentry xml:id="manual.bugs.dr539"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#539">539</link>:
<emphasis>partial_sum and adjacent_difference should mention
requirements</emphasis>
</term>
@@ -704,250 +706,250 @@ requirements of the license of GCC.
in adjacent_difference.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#541">541</link>:
+ <varlistentry xml:id="manual.bugs.dr541"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#541">541</link>:
<emphasis>shared_ptr template assignment and void</emphasis>
</term>
<listitem><para>Add an auto_ptr&lt;void&gt; specialization.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#543">543</link>:
+ <varlistentry xml:id="manual.bugs.dr543"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#543">543</link>:
<emphasis>valarray slice default constructor</emphasis>
</term>
<listitem><para>Follow the straightforward proposed resolution.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#550">550</link>:
+ <varlistentry xml:id="manual.bugs.dr550"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#550">550</link>:
<emphasis>What should the return type of pow(float,int) be?</emphasis>
</term>
<listitem><para>In C++11 mode, remove the pow(float,int), etc., signatures.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#586">586</link>:
+ <varlistentry xml:id="manual.bugs.dr586"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#586">586</link>:
<emphasis>string inserter not a formatted function</emphasis>
</term>
<listitem><para>Change it to be a formatted output function (i.e. catch exceptions).
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#596">596</link>:
+ <varlistentry xml:id="manual.bugs.dr596"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#596">596</link>:
<emphasis>27.8.1.3 Table 112 omits "a+" and "a+b" modes</emphasis>
</term>
<listitem><para>Add the missing modes to fopen_mode.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#630">630</link>:
+ <varlistentry xml:id="manual.bugs.dr630"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#630">630</link>:
<emphasis>arrays of valarray</emphasis>
</term>
<listitem><para>Implement the simple resolution.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#660">660</link>:
+ <varlistentry xml:id="manual.bugs.dr660"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#660">660</link>:
<emphasis>Missing bitwise operations</emphasis>
</term>
<listitem><para>Add the missing operations.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#691">691</link>:
+ <varlistentry xml:id="manual.bugs.dr691"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#691">691</link>:
<emphasis>const_local_iterator cbegin, cend missing from TR1</emphasis>
</term>
<listitem><para>In C++11 mode add cbegin(size_type) and cend(size_type)
to the unordered containers.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#693">693</link>:
+ <varlistentry xml:id="manual.bugs.dr693"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#693">693</link>:
<emphasis>std::bitset::all() missing</emphasis>
</term>
<listitem><para>Add it, consistently with the discussion.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#695">695</link>:
+ <varlistentry xml:id="manual.bugs.dr695"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#695">695</link>:
<emphasis>ctype&lt;char&gt;::classic_table() not accessible</emphasis>
</term>
<listitem><para>Make the member functions table and classic_table public.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#696">696</link>:
+ <varlistentry xml:id="manual.bugs.dr696"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#696">696</link>:
<emphasis>istream::operator&gt;&gt;(int&amp;) broken</emphasis>
</term>
<listitem><para>Implement the straightforward resolution.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#761">761</link>:
+ <varlistentry xml:id="manual.bugs.dr761"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#761">761</link>:
<emphasis>unordered_map needs an at() member function</emphasis>
</term>
<listitem><para>In C++11 mode, add at() and at() const.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#775">775</link>:
+ <varlistentry xml:id="manual.bugs.dr775"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#775">775</link>:
<emphasis>Tuple indexing should be unsigned?</emphasis>
</term>
<listitem><para>Implement the int -&gt; size_t replacements.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#776">776</link>:
+ <varlistentry xml:id="manual.bugs.dr776"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#776">776</link>:
<emphasis>Undescribed assign function of std::array</emphasis>
</term>
<listitem><para>In C++11 mode, remove assign, add fill.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#781">781</link>:
+ <varlistentry xml:id="manual.bugs.dr781"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#781">781</link>:
<emphasis>std::complex should add missing C99 functions</emphasis>
</term>
<listitem><para>In C++11 mode, add std::proj.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#809">809</link>:
+ <varlistentry xml:id="manual.bugs.dr809"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#809">809</link>:
<emphasis>std::swap should be overloaded for array types</emphasis>
</term>
<listitem><para>Add the overload.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#853">853</link>:
+ <varlistentry xml:id="manual.bugs.dr853"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#853">853</link>:
<emphasis>to_string needs updating with zero and one</emphasis>
</term>
<listitem><para>Update / add the signatures.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#865">865</link>:
+ <varlistentry xml:id="manual.bugs.dr865"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#865">865</link>:
<emphasis>More algorithms that throw away information</emphasis>
</term>
<listitem><para>The traditional HP / SGI return type and value is blessed
by the resolution of the DR.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#1339">1339</link>:
+ <varlistentry xml:id="manual.bugs.dr1339"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#1339">1339</link>:
<emphasis>uninitialized_fill_n should return the end of its range</emphasis>
</term>
<listitem><para>Return the end of the filled range.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2021">2021</link>:
+ <varlistentry xml:id="manual.bugs.dr2021"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2021">2021</link>:
<emphasis>Further incorrect uses of <code>result_of</code></emphasis>
</term>
<listitem><para>Correctly decay types in signature of <code>std::async</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2049">2049</link>:
+ <varlistentry xml:id="manual.bugs.dr2049"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2049">2049</link>:
<emphasis><code>is_destructible</code> underspecified</emphasis>
</term>
<listitem><para>Handle non-object types.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2056">2056</link>:
+ <varlistentry xml:id="manual.bugs.dr2056"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2056">2056</link>:
<emphasis>future_errc enums start with value 0 (invalid value for broken_promise)</emphasis>
</term>
<listitem><para>Reorder enumerators.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2059">2059</link>:
+ <varlistentry xml:id="manual.bugs.dr2059"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2059">2059</link>:
<emphasis>C++0x ambiguity problem with map::erase</emphasis>
</term>
<listitem><para>Add additional overloads.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2062">2062</link>:
+ <varlistentry xml:id="manual.bugs.dr2062"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2062">2062</link>:
<emphasis>2062. Effect contradictions w/o no-throw guarantee of <code>std::function</code> swaps</emphasis>
</term>
<listitem><para>Add <code>noexcept</code> to swap functions.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2063">2063</link>:
+ <varlistentry xml:id="manual.bugs.dr2063"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2063">2063</link>:
<emphasis>Contradictory requirements for string move assignment</emphasis>
</term>
<listitem><para>Respect propagation trait for move assignment.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2064">2064</link>:
+ <varlistentry xml:id="manual.bugs.dr2064"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2064">2064</link>:
<emphasis>More noexcept issues in basic_string</emphasis>
</term>
<listitem><para>Add noexcept to the comparison operators.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2067">2067</link>:
+ <varlistentry xml:id="manual.bugs.dr2067"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2067">2067</link>:
<emphasis>packaged_task should have deleted copy c'tor with const parameter</emphasis>
</term>
<listitem><para>Fix signatures.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2101">2101</link>:
+ <varlistentry xml:id="manual.bugs.dr2101"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2101">2101</link>:
<emphasis>Some transformation types can produce impossible types</emphasis>
</term>
<listitem><para>Use the referenceable type concept.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2106">2106</link>:
+ <varlistentry xml:id="manual.bugs.dr2106"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2106">2106</link>:
<emphasis>move_iterator wrapping iterators returning prvalues</emphasis>
</term>
<listitem><para>Change the <code>reference</code> type.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2108">2108</link>:
+ <varlistentry xml:id="manual.bugs.dr2108"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2108">2108</link>:
<emphasis>No way to identify allocator types that always compare equal</emphasis>
</term>
<listitem><para>Define and use <code>is_always_equal</code> even for C++11.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2118">2118</link>:
+ <varlistentry xml:id="manual.bugs.dr2118"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2118">2118</link>:
<emphasis><code>unique_ptr</code> for array does not support cv qualification conversion of actual argument</emphasis>
</term>
<listitem><para>Adjust constraints to allow safe conversions.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2127">2127</link>:
+ <varlistentry xml:id="manual.bugs.dr2127"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2127">2127</link>:
<emphasis>Move-construction with <code>raw_storage_iterator</code></emphasis>
</term>
<listitem><para>Add assignment operator taking an rvalue.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2132">2132</link>:
+ <varlistentry xml:id="manual.bugs.dr2132"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2132">2132</link>:
<emphasis><code>std::function</code> ambiguity</emphasis>
</term>
<listitem><para>Constrain the constructor to only accept callable types.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2141">2141</link>:
+ <varlistentry xml:id="manual.bugs.dr2141"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2141">2141</link>:
<emphasis><code>common_type</code> trait produces reference types</emphasis>
</term>
<listitem><para>Use <code>decay</code> for the result type.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2144">2144</link>:
+ <varlistentry xml:id="manual.bugs.dr2144"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2144">2144</link>:
<emphasis>Missing <code>noexcept</code> specification in <code>type_index</code></emphasis>
</term>
<listitem><para>Add <code>noexcept</code>
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2145">2145</link>:
+ <varlistentry xml:id="manual.bugs.dr2145"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2145">2145</link>:
<emphasis><code>error_category</code> default constructor</emphasis>
</term>
<listitem><para>Declare a public constexpr constructor.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2162">2162</link>:
+ <varlistentry xml:id="manual.bugs.dr2162"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2162">2162</link>:
<emphasis><code>allocator_traits::max_size</code> missing <code>noexcept</code></emphasis>
</term>
<listitem><para>Add <code>noexcept</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2187">2187</link>:
+ <varlistentry xml:id="manual.bugs.dr2187"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2187">2187</link>:
<emphasis><code>vector&lt;bool&gt;</code> is missing <code>emplace</code> and <code>emplace_back</code> member functions</emphasis>
</term>
<listitem><para>Add <code>emplace</code> and <code>emplace_back</code> member functions.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2192">2192</link>:
+ <varlistentry xml:id="manual.bugs.dr2192"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2192">2192</link>:
<emphasis>Validity and return type of <code>std::abs(0u)</code> is unclear</emphasis>
</term>
<listitem><para>Move all declarations to a common header and remove the
generic <code>abs</code> which accepted unsigned arguments.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2196">2196</link>:
+ <varlistentry xml:id="manual.bugs.dr2196"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2196">2196</link>:
<emphasis>Specification of <code>is_*[copy/move]_[constructible/assignable]</code> unclear for non-referencable types</emphasis>
</term>
<listitem><para>Use the referenceable type concept.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2212">2212</link>:
+ <varlistentry xml:id="manual.bugs.dr2212"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2212">2212</link>:
<emphasis><code>tuple_size</code> for <code>const pair</code> request <code>&lt;tuple&gt;</code> header</emphasis>
</term>
<listitem><para>The <code>tuple_size</code> and <code>tuple_element</code>
@@ -955,56 +957,56 @@ requirements of the license of GCC.
is included by <code>&lt;array&gt;</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2296">2296</link>:
+ <varlistentry xml:id="manual.bugs.dr2296"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2296">2296</link>:
<emphasis><code>std::addressof</code> should be constexpr</emphasis>
</term>
<listitem><para>Use <code>__builtin_addressof</code> and add
<code>constexpr</code> to <code>addressof</code> for C++17 and later.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2313">2313</link>:
+ <varlistentry xml:id="manual.bugs.dr2313"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2313">2313</link>:
<emphasis><code>tuple_size</code> should always derive from <code>integral_constant&lt;size_t, N&gt;</code></emphasis>
</term>
<listitem><para>Update definitions of the partial specializations for const and volatile types.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2328">2328</link>:
+ <varlistentry xml:id="manual.bugs.dr2328"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2328">2328</link>:
<emphasis>Rvalue stream extraction should use perfect forwarding</emphasis>
</term>
<listitem><para>Use perfect forwarding for right operand.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2329">2329</link>:
+ <varlistentry xml:id="manual.bugs.dr2329"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2329">2329</link>:
<emphasis><code>regex_match()/regex_search()</code> with <code>match_results</code> should forbid temporary strings</emphasis>
</term>
<listitem><para>Add deleted overloads for rvalue strings.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2332">2332</link>:
+ <varlistentry xml:id="manual.bugs.dr2332"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2332">2332</link>:
<emphasis><code>regex_iterator/regex_token_iterator</code> should forbid temporary regexes</emphasis>
</term>
<listitem><para>Add deleted constructors.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2399">2399</link>:
+ <varlistentry xml:id="manual.bugs.dr2399"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2399">2399</link>:
<emphasis><code>shared_ptr</code>'s constructor from <code>unique_ptr</code> should be constrained</emphasis>
</term>
<listitem><para>Constrain the constructor to require convertibility.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2400">2400</link>:
+ <varlistentry xml:id="manual.bugs.dr2400"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2400">2400</link>:
<emphasis><code>shared_ptr</code>'s <code>get_deleter()</code> should use <code>addressof()</code></emphasis>
</term>
<listitem><para>Use <code>addressof</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2401">2401</link>:
+ <varlistentry xml:id="manual.bugs.dr2401"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2401">2401</link>:
<emphasis><code>std::function</code> needs more <code>noexcept</code></emphasis>
</term>
<listitem><para>Add <code>noexcept</code> to the assignment and comparisons.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2407">2407</link>:
+ <varlistentry xml:id="manual.bugs.dr2407"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2407">2407</link>:
<emphasis><code>packaged_task(allocator_arg_t, const Allocator&amp;, F&amp;&amp;)</code>
should neither be constrained nor <code>explicit</code>
</emphasis>
@@ -1012,74 +1014,74 @@ requirements of the license of GCC.
<listitem><para>Remove <code>explicit</code> from the constructor.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2415">2415</link>:
+ <varlistentry xml:id="manual.bugs.dr2415"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2415">2415</link>:
<emphasis>Inconsistency between <code>unique_ptr</code> and <code>shared_ptr</code></emphasis>
</term>
<listitem><para>Create empty an <code>shared_ptr</code> from an empty
<code>unique_ptr</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2418">2418</link>:
+ <varlistentry xml:id="manual.bugs.dr2418"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2418">2418</link>:
<emphasis><code>apply</code> does not work with member pointers</emphasis>
</term>
<listitem><para>Use <code>mem_fn</code> for member pointers.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2440">2440</link>:
+ <varlistentry xml:id="manual.bugs.dr2440"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2440">2440</link>:
<emphasis><code>seed_seq::size()</code> should be <code>noexcept</code></emphasis>
</term>
<listitem><para>Add <code>noexcept</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2441">2441</link>:
+ <varlistentry xml:id="manual.bugs.dr2441"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2441">2441</link>:
<emphasis>Exact-width atomic typedefs should be provided</emphasis>
</term>
<listitem><para>Define the typedefs.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2442">2442</link>:
+ <varlistentry xml:id="manual.bugs.dr2442"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2442">2442</link>:
<emphasis><code>call_once()</code> shouldn't <code>DECAY_COPY()</code></emphasis>
</term>
<listitem><para>Remove indirection through call wrapper that made copies
of arguments and forward arguments straight to <code>std::invoke</code>.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2454">2454</link>:
+ <varlistentry xml:id="manual.bugs.dr2454"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2454">2454</link>:
<emphasis>Add <code>raw_storage_iterator::base()</code> member
</emphasis>
</term>
<listitem><para>Add the <code>base()</code> member function.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2455">2455</link>:
+ <varlistentry xml:id="manual.bugs.dr2455"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2455">2455</link>:
<emphasis>Allocator default construction should be allowed to throw
</emphasis>
</term>
<listitem><para>Make <code>noexcept</code> specifications conditional.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2458">2458</link>:
+ <varlistentry xml:id="manual.bugs.dr2458"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2458">2458</link>:
<emphasis>N3778 and new library deallocation signatures
</emphasis>
</term>
<listitem><para>Remove unused overloads.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2459">2459</link>:
+ <varlistentry xml:id="manual.bugs.dr2459"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2459">2459</link>:
<emphasis><code>std::polar</code> should require a non-negative rho
</emphasis>
</term>
<listitem><para>Add debug mode assertion.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2466">2466</link>:
+ <varlistentry xml:id="manual.bugs.dr2466"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2466">2466</link>:
<emphasis><code>allocator_traits::max_size()</code> default behavior is incorrect
</emphasis>
</term>
<listitem><para>Divide by the object type.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2484">2484</link>:
+ <varlistentry xml:id="manual.bugs.dr2484"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2484">2484</link>:
<emphasis><code>rethrow_if_nested()</code> is doubly unimplementable
</emphasis>
</term>
@@ -1087,21 +1089,21 @@ requirements of the license of GCC.
ill-formed.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2583">2583</link>:
+ <varlistentry xml:id="manual.bugs.dr2583"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2583">2583</link>:
<emphasis>There is no way to supply an allocator for <code>basic_string(str, pos)</code>
</emphasis>
</term>
<listitem><para>Add new constructor
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2684">2684</link>:
+ <varlistentry xml:id="manual.bugs.dr2684"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2684">2684</link>:
<emphasis><code>priority_queue</code> lacking comparator typedef
</emphasis>
</term>
<listitem><para>Define the <code>value_compare</code> typedef.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2770">2770</link>:
+ <varlistentry xml:id="manual.bugs.dr2770"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2770">2770</link>:
<emphasis><code>tuple_size&lt;const T&gt;</code> specialization is not
SFINAE compatible and breaks decomposition declarations
</emphasis>
@@ -1110,7 +1112,7 @@ requirements of the license of GCC.
only use it if valid.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2781">2781</link>:
+ <varlistentry xml:id="manual.bugs.dr2781"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2781">2781</link>:
<emphasis>Contradictory requirements for <code>std::function</code>
and <code>std::reference_wrapper</code>
</emphasis>
@@ -1119,7 +1121,7 @@ requirements of the license of GCC.
arguments and store them directly as the target object.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2802">2802</link>:
+ <varlistentry xml:id="manual.bugs.dr2802"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2802">2802</link>:
<emphasis>Add noexcept to several <code>shared_ptr</code> related
functions
</emphasis>
@@ -1127,14 +1129,14 @@ requirements of the license of GCC.
<listitem><para>Add noexcept.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2873">2873</link>:
+ <varlistentry xml:id="manual.bugs.dr2873"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2873">2873</link>:
<emphasis><code>shared_ptr</code> constructor requirements for a deleter
</emphasis>
</term>
<listitem><para>Use rvalues for deleters.
</para></listitem></varlistentry>
- <varlistentry><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2942">2942</link>:
+ <varlistentry xml:id="manual.bugs.dr2942"><term><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&DR;#2942">2942</link>:
<emphasis>LWG 2873's resolution missed
<code>weak_ptr::owner_before</code>
</emphasis>
diff --git a/libstdc++-v3/doc/xml/manual/using.xml b/libstdc++-v3/doc/xml/manual/using.xml
index 5c0e1b9f8c1..6ce29fd30be 100644
--- a/libstdc++-v3/doc/xml/manual/using.xml
+++ b/libstdc++-v3/doc/xml/manual/using.xml
@@ -991,6 +991,24 @@ g++ -Winvalid-pch -I. -include stdc++.h -H -g -O2 hello.cc -o test.exe
</listitem></varlistentry>
</variablelist>
+ <varlistentry><term><code>_GLIBCXX_SANITIZE_VECTOR</code></term>
+ <listitem>
+ <para>
+ Undefined by default. When defined, <classname>std::vector</classname>
+ operations will be annotated so that AddressSanitizer can detect
+ invalid accesses to the unused capacity of a
+ <classname>std::vector</classname>. These annotations are only
+ enabled for
+ <classname>std::vector&lt;T, std::allocator&lt;T&gt;&gt;</classname>
+ and only when <classname>std::allocator</classname> is derived from
+ <xref linkend="allocator.impl"><classname>new_allocator</classname>
+ or <classname>malloc_allocator</classname></xref>. The annotations
+ must be present on all vector operations or none, so this macro must
+ be defined to the same value for all translation units that create,
+ destroy or modify vectors.
+ </para>
+ </listitem></varlistentry>
+
</section>
<section xml:id="manual.intro.using.abi" xreflabel="Dual ABI">
diff --git a/libstdc++-v3/include/bits/algorithmfwd.h b/libstdc++-v3/include/bits/algorithmfwd.h
index 3ff4ff71230..673b98e7867 100644
--- a/libstdc++-v3/include/bits/algorithmfwd.h
+++ b/libstdc++-v3/include/bits/algorithmfwd.h
@@ -615,8 +615,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_FIter
upper_bound(_FIter, _FIter, const _Tp&, _Compare);
-_GLIBCXX_END_NAMESPACE_VERSION
-
_GLIBCXX_BEGIN_NAMESPACE_ALGO
template<typename _FIter>
@@ -845,6 +843,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
unique_copy(_IIter, _IIter, _OIter, _BinaryPredicate);
_GLIBCXX_END_NAMESPACE_ALGO
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#ifdef _GLIBCXX_PARALLEL
diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h
index 318e41b7c55..f0b8682b4fe 100644
--- a/libstdc++-v3/include/bits/basic_ios.h
+++ b/libstdc++-v3/include/bits/basic_ios.h
@@ -157,8 +157,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
- // Flip the internal state on for the proper state bits, then re
- // throws the propagated exception if bit also set in
+ // Flip the internal state on for the proper state bits, then
+ // rethrows the propagated exception if bit also set in
// exceptions().
void
_M_setstate(iostate __state)
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 519d686063e..a343d7b1628 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -2918,7 +2918,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
int
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const;
- };
+
+ // Allow basic_stringbuf::__xfer_bufptrs to call _M_length:
+ template<typename, typename, typename> friend class basic_stringbuf;
+ };
_GLIBCXX_END_NAMESPACE_CXX11
#else // !_GLIBCXX_USE_CXX11_ABI
// Reference-counted COW string implentation
@@ -6467,8 +6470,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ };
#endif
-_GLIBCXX_END_NAMESPACE_VERSION
-
#if __cplusplus > 201103L
#define __cpp_lib_string_udls 201304
@@ -6477,8 +6478,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
{
inline namespace string_literals
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
_GLIBCXX_DEFAULT_ABI_TAG
inline basic_string<char>
operator""s(const char* __str, size_t __len)
@@ -6503,12 +6502,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return basic_string<char32_t>{__str, __len}; }
#endif
-_GLIBCXX_END_NAMESPACE_VERSION
} // inline namespace string_literals
} // inline namespace literals
#endif // __cplusplus > 201103L
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 3e3905010f7..d5d1d24ee1a 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -267,88 +267,58 @@ namespace __gnu_cxx
# define _GLIBCXX_DEFAULT_ABI_TAG
#endif
-
// Defined if inline namespaces are used for versioning.
#define _GLIBCXX_INLINE_VERSION
// Inline namespace for symbol versioning.
#if _GLIBCXX_INLINE_VERSION
+# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __8 {
+# define _GLIBCXX_END_NAMESPACE_VERSION }
namespace std
{
- inline namespace __8 { }
-
- namespace rel_ops { inline namespace __8 { } }
-
- namespace tr1
- {
- inline namespace __8 { }
- namespace placeholders { inline namespace __8 { } }
- namespace regex_constants { inline namespace __8 { } }
- namespace __detail { inline namespace __8 { } }
- }
-
- namespace tr2
- { inline namespace __8 { } }
-
- namespace decimal { inline namespace __8 { } }
-
-#if __cplusplus >= 201103L
- namespace chrono { inline namespace __8 { } }
- namespace placeholders { inline namespace __8 { } }
- namespace regex_constants { inline namespace __8 { } }
- namespace this_thread { inline namespace __8 { } }
-
+inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
#if __cplusplus >= 201402L
inline namespace literals {
- inline namespace chrono_literals { inline namespace __8 { } }
- inline namespace complex_literals { inline namespace __8 { } }
- inline namespace string_literals { inline namespace __8 { } }
+ inline namespace chrono_literals { }
+ inline namespace complex_literals { }
+ inline namespace string_literals { }
#if __cplusplus > 201402L
- inline namespace string_view_literals { inline namespace __8 { } }
+ inline namespace string_view_literals { }
#endif // C++17
}
#endif // C++14
-#endif // C++11
-
- namespace __detail {
- inline namespace __8 { }
-#if __cplusplus > 201402L
- namespace __variant { inline namespace __8 { } }
-#endif
- }
+_GLIBCXX_END_NAMESPACE_VERSION
}
namespace __gnu_cxx
{
- inline namespace __8 { }
- namespace __detail { inline namespace __8 { } }
+inline _GLIBCXX_BEGIN_NAMESPACE_VERSION
+_GLIBCXX_END_NAMESPACE_VERSION
}
-# define _GLIBCXX_BEGIN_NAMESPACE_VERSION namespace __8 {
-# define _GLIBCXX_END_NAMESPACE_VERSION }
+
#else
# define _GLIBCXX_BEGIN_NAMESPACE_VERSION
# define _GLIBCXX_END_NAMESPACE_VERSION
#endif
-
// Inline namespaces for special modes: debug, parallel, profile.
#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL) \
|| defined(_GLIBCXX_PROFILE)
namespace std
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
// Non-inline namespace for components replaced by alternates in active mode.
namespace __cxx1998
{
-# if _GLIBCXX_INLINE_VERSION
- inline namespace __8 { }
-# endif
-
# if _GLIBCXX_USE_CXX11_ABI
inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
# endif
}
+_GLIBCXX_END_NAMESPACE_VERSION
+
// Inline namespace for debug mode.
# ifdef _GLIBCXX_DEBUG
inline namespace __debug { }
@@ -396,25 +366,23 @@ namespace std
#if defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PROFILE)
# define _GLIBCXX_STD_C __cxx1998
# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER \
- namespace _GLIBCXX_STD_C { _GLIBCXX_BEGIN_NAMESPACE_VERSION
-# define _GLIBCXX_END_NAMESPACE_CONTAINER \
- _GLIBCXX_END_NAMESPACE_VERSION }
+ namespace _GLIBCXX_STD_C {
+# define _GLIBCXX_END_NAMESPACE_CONTAINER }
#else
# define _GLIBCXX_STD_C std
-# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER _GLIBCXX_BEGIN_NAMESPACE_VERSION
-# define _GLIBCXX_END_NAMESPACE_CONTAINER _GLIBCXX_END_NAMESPACE_VERSION
+# define _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
+# define _GLIBCXX_END_NAMESPACE_CONTAINER
#endif
#ifdef _GLIBCXX_PARALLEL
# define _GLIBCXX_STD_A __cxx1998
# define _GLIBCXX_BEGIN_NAMESPACE_ALGO \
- namespace _GLIBCXX_STD_A { _GLIBCXX_BEGIN_NAMESPACE_VERSION
-# define _GLIBCXX_END_NAMESPACE_ALGO \
- _GLIBCXX_END_NAMESPACE_VERSION }
+ namespace _GLIBCXX_STD_A {
+# define _GLIBCXX_END_NAMESPACE_ALGO }
#else
# define _GLIBCXX_STD_A std
-# define _GLIBCXX_BEGIN_NAMESPACE_ALGO _GLIBCXX_BEGIN_NAMESPACE_VERSION
-# define _GLIBCXX_END_NAMESPACE_ALGO _GLIBCXX_END_NAMESPACE_VERSION
+# define _GLIBCXX_BEGIN_NAMESPACE_ALGO
+# define _GLIBCXX_END_NAMESPACE_ALGO
#endif
// GLIBCXX_ABI Deprecated
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index 38a6e82aaef..d25ad690178 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -58,6 +58,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
#if __cplusplus >= 201103L
@@ -1107,6 +1108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
#endif
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif
diff --git a/libstdc++-v3/include/bits/forward_list.h b/libstdc++-v3/include/bits/forward_list.h
index f319b7f0607..9d86fcc1568 100644
--- a/libstdc++-v3/include/bits/forward_list.h
+++ b/libstdc++-v3/include/bits/forward_list.h
@@ -43,6 +43,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/**
@@ -1440,6 +1441,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ __lx.swap(__ly); }
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // _FORWARD_LIST_H
diff --git a/libstdc++-v3/include/bits/forward_list.tcc b/libstdc++-v3/include/bits/forward_list.tcc
index b823b09e1af..64bd9c4bf13 100644
--- a/libstdc++-v3/include/bits/forward_list.tcc
+++ b/libstdc++-v3/include/bits/forward_list.tcc
@@ -32,6 +32,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Alloc>
@@ -493,6 +494,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _FORWARD_LIST_TCC */
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index b1beff86ab5..12ea977b997 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -649,11 +649,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
else if (_M_writing)
{
- if (overflow() == traits_type::eof())
- return __ret;
- _M_set_buffer(-1);
- _M_writing = false;
- }
+ if (overflow() == traits_type::eof())
+ return __ret;
+ _M_set_buffer(-1);
+ _M_writing = false;
+ }
// Optimization in the always_noconv() case, to be generalized in the
// future: when __n > __buflen we read directly instead of using the
@@ -662,57 +662,55 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const streamsize __buflen = _M_buf_size > 1 ? _M_buf_size - 1 : 1;
if (__n > __buflen && __check_facet(_M_codecvt).always_noconv()
- && __testin)
- {
- // First, copy the chars already present in the buffer.
- const streamsize __avail = this->egptr() - this->gptr();
- if (__avail != 0)
- {
- traits_type::copy(__s, this->gptr(), __avail);
- __s += __avail;
- this->setg(this->eback(), this->gptr() + __avail,
- this->egptr());
- __ret += __avail;
- __n -= __avail;
- }
-
- // Need to loop in case of short reads (relatively common
- // with pipes).
- streamsize __len;
- for (;;)
- {
- __len = _M_file.xsgetn(reinterpret_cast<char*>(__s),
- __n);
- if (__len == -1)
- __throw_ios_failure(__N("basic_filebuf::xsgetn "
- "error reading the file"));
- if (__len == 0)
- break;
-
- __n -= __len;
- __ret += __len;
- if (__n == 0)
- break;
+ && __testin)
+ {
+ // First, copy the chars already present in the buffer.
+ const streamsize __avail = this->egptr() - this->gptr();
+ if (__avail != 0)
+ {
+ traits_type::copy(__s, this->gptr(), __avail);
+ __s += __avail;
+ this->setg(this->eback(), this->gptr() + __avail, this->egptr());
+ __ret += __avail;
+ __n -= __avail;
+ }
- __s += __len;
- }
+ // Need to loop in case of short reads (relatively common
+ // with pipes).
+ streamsize __len;
+ for (;;)
+ {
+ __len = _M_file.xsgetn(reinterpret_cast<char*>(__s), __n);
+ if (__len == -1)
+ __throw_ios_failure(__N("basic_filebuf::xsgetn "
+ "error reading the file"));
+ if (__len == 0)
+ break;
- if (__n == 0)
- {
- _M_set_buffer(0);
- _M_reading = true;
- }
- else if (__len == 0)
- {
- // If end of file is reached, set 'uncommitted'
- // mode, thus allowing an immediate write without
- // an intervening seek.
- _M_set_buffer(-1);
- _M_reading = false;
- }
- }
+ __n -= __len;
+ __ret += __len;
+ if (__n == 0)
+ break;
+
+ __s += __len;
+ }
+
+ if (__n == 0)
+ {
+ // Set _M_reading. Buffer is already in initial 'read' mode.
+ _M_reading = true;
+ }
+ else if (__len == 0)
+ {
+ // If end of file is reached, set 'uncommitted'
+ // mode, thus allowing an immediate write without
+ // an intervening seek.
+ _M_set_buffer(-1);
+ _M_reading = false;
+ }
+ }
else
- __ret += __streambuf_type::xsgetn(__s, __n);
+ __ret += __streambuf_type::xsgetn(__s, __n);
return __ret;
}
@@ -729,7 +727,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const bool __testout = (_M_mode & ios_base::out
|| _M_mode & ios_base::app);
if (__check_facet(_M_codecvt).always_noconv()
- && __testout && !_M_reading)
+ && __testout && !_M_reading)
{
// Measurement would reveal the best choice.
const streamsize __chunk = 1ul << 10;
@@ -839,8 +837,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
if (_M_writing)
__computed_off = this->pptr() - this->pbase();
- off_type __file_off = _M_file.seekoff(0, ios_base::cur);
- if (__file_off != off_type(-1))
+ off_type __file_off = _M_file.seekoff(0, ios_base::cur);
+ if (__file_off != off_type(-1))
{
__ret = __file_off + __computed_off;
__ret.state(__state);
diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h
index 8af8c498de2..a3a31d1fb11 100644
--- a/libstdc++-v3/include/bits/hashtable_policy.h
+++ b/libstdc++-v3/include/bits/hashtable_policy.h
@@ -43,12 +43,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typename _RehashPolicy, typename _Traits>
class _Hashtable;
-_GLIBCXX_END_NAMESPACE_VERSION
-
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @defgroup hashtable-detail Base and Implementation Classes
* @ingroup unordered_associative_containers
@@ -2122,8 +2118,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
//@} hashtable-detail
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // _HASHTABLE_POLICY_H
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index e5a107db4bc..e68b4305517 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -469,13 +469,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// Request a seek relative to the current end of the sequence.
static const seekdir end = _S_end;
- // Annex D.6
+#if __cplusplus <= 201402L
+ // Annex D.6 (removed in C++17)
typedef int io_state;
typedef int open_mode;
typedef int seek_dir;
typedef std::streampos streampos;
typedef std::streamoff streamoff;
+#endif
// Callbacks;
/**
diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc
index b390f743bba..92df9d126ef 100644
--- a/libstdc++-v3/include/bits/istream.tcc
+++ b/libstdc++-v3/include/bits/istream.tcc
@@ -48,28 +48,36 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
ios_base::iostate __err = ios_base::goodbit;
if (__in.good())
- {
- if (__in.tie())
- __in.tie()->flush();
- if (!__noskip && bool(__in.flags() & ios_base::skipws))
- {
- const __int_type __eof = traits_type::eof();
- __streambuf_type* __sb = __in.rdbuf();
- __int_type __c = __sb->sgetc();
-
- const __ctype_type& __ct = __check_facet(__in._M_ctype);
- while (!traits_type::eq_int_type(__c, __eof)
- && __ct.is(ctype_base::space,
- traits_type::to_char_type(__c)))
- __c = __sb->snextc();
+ __try
+ {
+ if (__in.tie())
+ __in.tie()->flush();
+ if (!__noskip && bool(__in.flags() & ios_base::skipws))
+ {
+ const __int_type __eof = traits_type::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+
+ const __ctype_type& __ct = __check_facet(__in._M_ctype);
+ while (!traits_type::eq_int_type(__c, __eof)
+ && __ct.is(ctype_base::space,
+ traits_type::to_char_type(__c)))
+ __c = __sb->snextc();
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 195. Should basic_istream::sentry's constructor ever
- // set eofbit?
- if (traits_type::eq_int_type(__c, __eof))
- __err |= ios_base::eofbit;
- }
- }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 195. Should basic_istream::sentry's constructor ever
+ // set eofbit?
+ if (traits_type::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ }
+ __catch(__cxxabiv1::__forced_unwind&)
+ {
+ __in._M_setstate(ios_base::badbit);
+ __throw_exception_again;
+ }
+ __catch(...)
+ { __in._M_setstate(ios_base::badbit); }
if (__in.good() && __err == ios_base::goodbit)
_M_ok = true;
diff --git a/libstdc++-v3/include/bits/list.tcc b/libstdc++-v3/include/bits/list.tcc
index fcb8353e09f..e21dab54263 100644
--- a/libstdc++-v3/include/bits/list.tcc
+++ b/libstdc++-v3/include/bits/list.tcc
@@ -58,6 +58,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Alloc>
@@ -594,6 +595,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _LIST_TCC */
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index 1ad0eb5ab66..9a74677b393 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -1487,7 +1487,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
protected:
virtual
- ~ctype_byname() { };
+ ~ctype_byname() { }
};
/// 22.2.1.4 Class ctype_byname specializations.
@@ -2486,7 +2486,7 @@ _GLIBCXX_BEGIN_NAMESPACE_LDBL
/// Destructor.
virtual
- ~num_put() { };
+ ~num_put() { }
//@{
/**
diff --git a/libstdc++-v3/include/bits/locale_facets_nonio.h b/libstdc++-v3/include/bits/locale_facets_nonio.h
index 0cd307fb5ed..0068cd3addd 100644
--- a/libstdc++-v3/include/bits/locale_facets_nonio.h
+++ b/libstdc++-v3/include/bits/locale_facets_nonio.h
@@ -898,7 +898,7 @@ _GLIBCXX_END_NAMESPACE_CXX11
explicit
time_put_byname(const char*, size_t __refs = 0)
: time_put<_CharT, _OutIter>(__refs)
- { };
+ { }
#if __cplusplus >= 201103L
explicit
diff --git a/libstdc++-v3/include/bits/move.h b/libstdc++-v3/include/bits/move.h
index 5f47b0e7bae..373f9556524 100644
--- a/libstdc++-v3/include/bits/move.h
+++ b/libstdc++-v3/include/bits/move.h
@@ -47,10 +47,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__addressof(_Tp& __r) _GLIBCXX_NOEXCEPT
{ return __builtin_addressof(__r); }
+#if __cplusplus >= 201103L
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-#if __cplusplus >= 201103L
#include <type_traits> // Brings in std::declval too.
namespace std _GLIBCXX_VISIBILITY(default)
@@ -153,8 +154,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
/// @} group utilities
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
#define _GLIBCXX_MOVE(__val) std::move(__val)
#define _GLIBCXX_FORWARD(_Tp, __val) std::forward<_Tp>(__val)
@@ -163,10 +162,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_FORWARD(_Tp, __val) (__val)
#endif
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @addtogroup utilities
* @{
diff --git a/libstdc++-v3/include/bits/quoted_string.h b/libstdc++-v3/include/bits/quoted_string.h
index 10cfec21181..0e51c223433 100644
--- a/libstdc++-v3/include/bits/quoted_string.h
+++ b/libstdc++-v3/include/bits/quoted_string.h
@@ -39,9 +39,9 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
- namespace __detail {
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+ namespace __detail {
/**
* @brief Struct for delimited strings.
*/
@@ -155,9 +155,9 @@ namespace std _GLIBCXX_VISIBILITY(default)
return __is;
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index bb761ec8fb0..2b022b2f469 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -58,15 +58,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_RealType
generate_canonical(_UniformRandomNumberGenerator& __g);
-_GLIBCXX_END_NAMESPACE_VERSION
-
/*
* Implementation-space details.
*/
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _UIntType, size_t __w,
bool = __w < static_cast<size_t>
(std::numeric_limits<_UIntType>::digits)>
@@ -189,11 +185,8 @@ _GLIBCXX_END_NAMESPACE_VERSION
_Engine& _M_g;
};
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @addtogroup random_generators Random Number Generators
* @ingroup random
@@ -520,7 +513,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*/
static constexpr result_type
min()
- { return 0; };
+ { return 0; }
/**
* @brief Gets the largest possible value in the output range.
diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc
index 63d1c020285..95bcf0a163e 100644
--- a/libstdc++-v3/include/bits/random.tcc
+++ b/libstdc++-v3/include/bits/random.tcc
@@ -34,13 +34,13 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
/*
* (Further) implementation-space details.
*/
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// General case for x = (ax + c) mod m -- use Schrage's algorithm
// to avoid integer overflow.
//
@@ -89,11 +89,8 @@ namespace std _GLIBCXX_VISIBILITY(default)
return __result;
}
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
constexpr _UIntType
linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier;
diff --git a/libstdc++-v3/include/bits/regex.h b/libstdc++-v3/include/bits/regex.h
index 0bb88cb6afb..32e7159eec9 100644
--- a/libstdc++-v3/include/bits/regex.h
+++ b/libstdc++-v3/include/bits/regex.h
@@ -39,12 +39,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
class match_results;
_GLIBCXX_END_NAMESPACE_CXX11
-_GLIBCXX_END_NAMESPACE_VERSION
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
enum class _RegexExecutorPolicy : int
{ _S_auto, _S_alternate };
@@ -53,19 +50,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_RegexExecutorPolicy __policy,
bool __match_mode>
bool
- __regex_algo_impl(_BiIter __s,
- _BiIter __e,
+ __regex_algo_impl(_BiIter __s,
+ _BiIter __e,
match_results<_BiIter, _Alloc>& __m,
const basic_regex<_CharT, _TraitsT>& __re,
regex_constants::match_flag_type __flags);
template<typename, typename, typename, bool>
class _Executor;
-
-_GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CXX11
/**
@@ -87,9 +81,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
struct regex_traits
{
public:
- typedef _Ch_type char_type;
- typedef std::basic_string<char_type> string_type;
- typedef std::locale locale_type;
+ typedef _Ch_type char_type;
+ typedef std::basic_string<char_type> string_type;
+ typedef std::locale locale_type;
private:
struct _RegexMask
{
@@ -397,8 +391,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
"regex traits class must have the same char_type");
// types:
- typedef _Ch_type value_type;
- typedef _Rx_traits traits_type;
+ typedef _Ch_type value_type;
+ typedef _Rx_traits traits_type;
typedef typename traits_type::string_type string_type;
typedef regex_constants::syntax_option_type flag_type;
typedef typename traits_type::locale_type locale_type;
@@ -771,20 +765,17 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
template<typename _Bp, typename _Ap, typename _Cp, typename _Rp,
__detail::_RegexExecutorPolicy, bool>
- friend bool __detail::
-#if _GLIBCXX_INLINE_VERSION
- __8:: // Required due to PR c++/59256
-#endif
- __regex_algo_impl(_Bp, _Bp, match_results<_Bp, _Ap>&,
- const basic_regex<_Cp, _Rp>&,
- regex_constants::match_flag_type);
+ friend bool
+ __detail::__regex_algo_impl(_Bp, _Bp, match_results<_Bp, _Ap>&,
+ const basic_regex<_Cp, _Rp>&,
+ regex_constants::match_flag_type);
template<typename, typename, typename, bool>
friend class __detail::_Executor;
- flag_type _M_flags;
- locale_type _M_loc;
- _AutomatonPtr _M_automaton;
+ flag_type _M_flags;
+ locale_type _M_loc;
+ _AutomatonPtr _M_automaton;
};
#if __cpp_deduction_guides >= 201606
@@ -837,8 +828,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
public:
typedef typename __iter_traits::value_type value_type;
typedef typename __iter_traits::difference_type difference_type;
- typedef _BiIter iterator;
- typedef std::basic_string<value_type> string_type;
+ typedef _BiIter iterator;
+ typedef std::basic_string<value_type> string_type;
bool matched;
@@ -923,14 +914,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
/** @brief Standard regex submatch over a C-style null-terminated string. */
- typedef sub_match<const char*> csub_match;
+ typedef sub_match<const char*> csub_match;
/** @brief Standard regex submatch over a standard string. */
typedef sub_match<string::const_iterator> ssub_match;
#ifdef _GLIBCXX_USE_WCHAR_T
/** @brief Regex submatch over a C-style null-terminated wide string. */
- typedef sub_match<const wchar_t*> wcsub_match;
+ typedef sub_match<const wchar_t*> wcsub_match;
/** @brief Regex submatch over a standard wide string. */
typedef sub_match<wstring::const_iterator> wssub_match;
@@ -1548,16 +1539,16 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
* @name 10.? Public Types
*/
//@{
- typedef sub_match<_Bi_iter> value_type;
- typedef const value_type& const_reference;
- typedef const_reference reference;
- typedef typename _Base_type::const_iterator const_iterator;
- typedef const_iterator iterator;
+ typedef sub_match<_Bi_iter> value_type;
+ typedef const value_type& const_reference;
+ typedef const_reference reference;
+ typedef typename _Base_type::const_iterator const_iterator;
+ typedef const_iterator iterator;
typedef typename __iter_traits::difference_type difference_type;
typedef typename allocator_traits<_Alloc>::size_type size_type;
- typedef _Alloc allocator_type;
+ typedef _Alloc allocator_type;
typedef typename __iter_traits::value_type char_type;
- typedef std::basic_string<char_type> string_type;
+ typedef std::basic_string<char_type> string_type;
//@}
public:
@@ -1872,13 +1863,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
template<typename _Bp, typename _Ap, typename _Cp, typename _Rp,
__detail::_RegexExecutorPolicy, bool>
- friend bool __detail::
-#if _GLIBCXX_INLINE_VERSION
- __8:: // Required due to PR c++/59256
-#endif
- __regex_algo_impl(_Bp, _Bp, match_results<_Bp, _Ap>&,
- const basic_regex<_Cp, _Rp>&,
- regex_constants::match_flag_type);
+ friend bool
+ __detail::__regex_algo_impl(_Bp, _Bp, match_results<_Bp, _Ap>&,
+ const basic_regex<_Cp, _Rp>&,
+ regex_constants::match_flag_type);
void
_M_resize(unsigned int __size)
@@ -1911,10 +1899,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
_Bi_iter _M_begin;
};
- typedef match_results<const char*> cmatch;
- typedef match_results<string::const_iterator> smatch;
+ typedef match_results<const char*> cmatch;
+ typedef match_results<string::const_iterator> smatch;
#ifdef _GLIBCXX_USE_WCHAR_T
- typedef match_results<const wchar_t*> wcmatch;
+ typedef match_results<const wchar_t*> wcmatch;
typedef match_results<wstring::const_iterator> wsmatch;
#endif
@@ -1994,11 +1982,11 @@ _GLIBCXX_END_NAMESPACE_CXX11
template<typename _Bi_iter, typename _Alloc,
typename _Ch_type, typename _Rx_traits>
inline bool
- regex_match(_Bi_iter __s,
- _Bi_iter __e,
- match_results<_Bi_iter, _Alloc>& __m,
+ regex_match(_Bi_iter __s,
+ _Bi_iter __e,
+ match_results<_Bi_iter, _Alloc>& __m,
const basic_regex<_Ch_type, _Rx_traits>& __re,
- regex_constants::match_flag_type __flags
+ regex_constants::match_flag_type __flags
= regex_constants::match_default)
{
return __detail::__regex_algo_impl<_Bi_iter, _Alloc, _Ch_type, _Rx_traits,
@@ -2452,11 +2440,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
{
public:
typedef basic_regex<_Ch_type, _Rx_traits> regex_type;
- typedef match_results<_Bi_iter> value_type;
- typedef std::ptrdiff_t difference_type;
- typedef const value_type* pointer;
- typedef const value_type& reference;
- typedef std::forward_iterator_tag iterator_category;
+ typedef match_results<_Bi_iter> value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
/**
* @brief Provides a singular iterator, useful for indicating
@@ -2543,18 +2531,18 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
}
private:
- _Bi_iter _M_begin;
- _Bi_iter _M_end;
- const regex_type* _M_pregex;
- regex_constants::match_flag_type _M_flags;
- match_results<_Bi_iter> _M_match;
+ _Bi_iter _M_begin;
+ _Bi_iter _M_end;
+ const regex_type* _M_pregex;
+ regex_constants::match_flag_type _M_flags;
+ match_results<_Bi_iter> _M_match;
};
- typedef regex_iterator<const char*> cregex_iterator;
- typedef regex_iterator<string::const_iterator> sregex_iterator;
+ typedef regex_iterator<const char*> cregex_iterator;
+ typedef regex_iterator<string::const_iterator> sregex_iterator;
#ifdef _GLIBCXX_USE_WCHAR_T
- typedef regex_iterator<const wchar_t*> wcregex_iterator;
- typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
+ typedef regex_iterator<const wchar_t*> wcregex_iterator;
+ typedef regex_iterator<wstring::const_iterator> wsregex_iterator;
#endif
// [7.12.2] Class template regex_token_iterator
@@ -2571,12 +2559,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
class regex_token_iterator
{
public:
- typedef basic_regex<_Ch_type, _Rx_traits> regex_type;
- typedef sub_match<_Bi_iter> value_type;
- typedef std::ptrdiff_t difference_type;
- typedef const value_type* pointer;
- typedef const value_type& reference;
- typedef std::forward_iterator_tag iterator_category;
+ typedef basic_regex<_Ch_type, _Rx_traits> regex_type;
+ typedef sub_match<_Bi_iter> value_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const value_type* pointer;
+ typedef const value_type& reference;
+ typedef std::forward_iterator_tag iterator_category;
public:
/**
@@ -2778,25 +2766,25 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
_M_result = nullptr;
}
- _Position _M_position;
- std::vector<int> _M_subs;
- value_type _M_suffix;
- std::size_t _M_n;
- const value_type* _M_result;
+ _Position _M_position;
+ std::vector<int> _M_subs;
+ value_type _M_suffix;
+ std::size_t _M_n;
+ const value_type* _M_result;
// Show whether _M_subs contains -1
- bool _M_has_m1;
+ bool _M_has_m1;
};
/** @brief Token iterator for C-style NULL-terminated strings. */
- typedef regex_token_iterator<const char*> cregex_token_iterator;
+ typedef regex_token_iterator<const char*> cregex_token_iterator;
/** @brief Token iterator for standard strings. */
- typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
+ typedef regex_token_iterator<string::const_iterator> sregex_token_iterator;
#ifdef _GLIBCXX_USE_WCHAR_T
/** @brief Token iterator for C-style NULL-terminated wide strings. */
- typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
+ typedef regex_token_iterator<const wchar_t*> wcregex_token_iterator;
/** @brief Token iterator for standard wide-character strings. */
typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
diff --git a/libstdc++-v3/include/bits/regex.tcc b/libstdc++-v3/include/bits/regex.tcc
index dc32a49dcd9..fc2d5846c46 100644
--- a/libstdc++-v3/include/bits/regex.tcc
+++ b/libstdc++-v3/include/bits/regex.tcc
@@ -30,10 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
// Result of merging regex_match and regex_search.
//
// __policy now can be _S_auto (auto dispatch) and _S_alternate (use
@@ -118,12 +118,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
return __ret;
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Ch_type>
template<typename _Fwd_iter>
typename regex_traits<_Ch_type>::string_type
@@ -663,4 +659,3 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
-
diff --git a/libstdc++-v3/include/bits/regex_automaton.h b/libstdc++-v3/include/bits/regex_automaton.h
index a5fab6356cc..00d1bd295cd 100644
--- a/libstdc++-v3/include/bits/regex_automaton.h
+++ b/libstdc++-v3/include/bits/regex_automaton.h
@@ -35,10 +35,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
/**
* @defgroup regex-detail Base and Implementation Classes
* @ingroup regex
@@ -393,8 +393,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
//@} regex-detail
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#include <bits/regex_automaton.tcc>
diff --git a/libstdc++-v3/include/bits/regex_automaton.tcc b/libstdc++-v3/include/bits/regex_automaton.tcc
index 727bde1f6c6..573b059a251 100644
--- a/libstdc++-v3/include/bits/regex_automaton.tcc
+++ b/libstdc++-v3/include/bits/regex_automaton.tcc
@@ -30,10 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
#ifdef _GLIBCXX_DEBUG
inline std::ostream&
_State_base::_M_print(std::ostream& ostr) const
@@ -233,7 +233,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
return _StateSeq(_M_nfa, __m[_M_start], __m[_M_end]);
}
+} // namespace __detail
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace __detail
} // namespace
diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h
index 2c00939f6f9..5d46cd43bd3 100644
--- a/libstdc++-v3/include/bits/regex_compiler.h
+++ b/libstdc++-v3/include/bits/regex_compiler.h
@@ -37,12 +37,9 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
class regex_traits;
_GLIBCXX_END_NAMESPACE_CXX11
-_GLIBCXX_END_NAMESPACE_VERSION
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @addtogroup regex-detail
* @{
@@ -575,8 +572,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
//@} regex-detail
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#include <bits/regex_compiler.tcc>
diff --git a/libstdc++-v3/include/bits/regex_compiler.tcc b/libstdc++-v3/include/bits/regex_compiler.tcc
index a6d8016d87f..1f7dd91b643 100644
--- a/libstdc++-v3/include/bits/regex_compiler.tcc
+++ b/libstdc++-v3/include/bits/regex_compiler.tcc
@@ -55,10 +55,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
template<typename _TraitsT>
_Compiler<_TraitsT>::
_Compiler(_IterT __b, _IterT __e,
@@ -633,7 +633,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return false;
}() ^ _M_is_non_matching;
}
+} // namespace __detail
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace __detail
} // namespace
diff --git a/libstdc++-v3/include/bits/regex_constants.h b/libstdc++-v3/include/bits/regex_constants.h
index dad2d637aa8..12c9eea4985 100644
--- a/libstdc++-v3/include/bits/regex_constants.h
+++ b/libstdc++-v3/include/bits/regex_constants.h
@@ -32,6 +32,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
/**
* @defgroup regex Regular Expressions
*
@@ -45,8 +47,6 @@ namespace std _GLIBCXX_VISIBILITY(default)
*/
namespace regex_constants
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @name 5.1 Regular Expression Syntax Options
*/
@@ -408,10 +408,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __a = __a ^ __b; }
//@}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace regex_constants
-
/* @} */ // group regex
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
diff --git a/libstdc++-v3/include/bits/regex_error.h b/libstdc++-v3/include/bits/regex_error.h
index 55f6db9cf7a..f2a3389e984 100644
--- a/libstdc++-v3/include/bits/regex_error.h
+++ b/libstdc++-v3/include/bits/regex_error.h
@@ -32,6 +32,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
/**
* @addtogroup regex
* @{
@@ -39,8 +41,6 @@ namespace std _GLIBCXX_VISIBILITY(default)
namespace regex_constants
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @name 5.3 Error Types
*/
@@ -120,11 +120,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr error_type error_stack(_S_error_stack);
//@}
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace regex_constants
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// [7.8] Class regex_error
/**
* @brief A regular expression exception class.
diff --git a/libstdc++-v3/include/bits/regex_executor.h b/libstdc++-v3/include/bits/regex_executor.h
index 61054742870..3d1f2516f50 100644
--- a/libstdc++-v3/include/bits/regex_executor.h
+++ b/libstdc++-v3/include/bits/regex_executor.h
@@ -32,10 +32,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
/**
* @addtogroup regex-detail
* @{
@@ -251,8 +251,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
//@} regex-detail
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#include <bits/regex_executor.tcc>
diff --git a/libstdc++-v3/include/bits/regex_executor.tcc b/libstdc++-v3/include/bits/regex_executor.tcc
index 9d4ece74416..226e05856e1 100644
--- a/libstdc++-v3/include/bits/regex_executor.tcc
+++ b/libstdc++-v3/include/bits/regex_executor.tcc
@@ -30,10 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
template<typename _BiIter, typename _Alloc, typename _TraitsT,
bool __dfs_mode>
bool _Executor<_BiIter, _Alloc, _TraitsT, __dfs_mode>::
@@ -513,7 +513,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __left_is_word != __right_is_word;
}
+} // namespace __detail
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace __detail
} // namespace
diff --git a/libstdc++-v3/include/bits/regex_scanner.h b/libstdc++-v3/include/bits/regex_scanner.h
index 37ad862a669..670efeda69f 100644
--- a/libstdc++-v3/include/bits/regex_scanner.h
+++ b/libstdc++-v3/include/bits/regex_scanner.h
@@ -30,10 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
/**
* @addtogroup regex-detail
* @{
@@ -265,8 +265,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
//@} regex-detail
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#include <bits/regex_scanner.tcc>
diff --git a/libstdc++-v3/include/bits/regex_scanner.tcc b/libstdc++-v3/include/bits/regex_scanner.tcc
index ad0b0477f3c..c65bfe2f68d 100644
--- a/libstdc++-v3/include/bits/regex_scanner.tcc
+++ b/libstdc++-v3/include/bits/regex_scanner.tcc
@@ -48,10 +48,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
template<typename _CharT>
_Scanner<_CharT>::
_Scanner(typename _Scanner::_IterT __begin,
@@ -584,6 +584,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
#endif
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
diff --git a/libstdc++-v3/include/bits/specfun.h b/libstdc++-v3/include/bits/specfun.h
index 82bd02e227a..0aaebeab7ac 100644
--- a/libstdc++-v3/include/bits/specfun.h
+++ b/libstdc++-v3/include/bits/specfun.h
@@ -1203,6 +1203,7 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Confluent hypergeometric functions
@@ -1302,6 +1303,7 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
return std::__detail::__hyperg<__type>(__a, __b, __c, __x);
}
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __gnu_cxx
#pragma GCC visibility pop
diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc
index 72e8742b4cf..56c53bc5923 100644
--- a/libstdc++-v3/include/bits/sstream.tcc
+++ b/libstdc++-v3/include/bits/sstream.tcc
@@ -88,6 +88,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return traits_type::not_eof(__c);
const __size_type __capacity = _M_string.capacity();
+
+#if _GLIBCXX_USE_CXX11_ABI
+ if ((this->epptr() - this->pbase()) < __capacity)
+ {
+ // There is additional capacity in _M_string that can be used.
+ char_type* __base = const_cast<char_type*>(_M_string.data());
+ _M_pbump(__base, __base + __capacity, this->pptr() - this->pbase());
+ if (_M_mode & ios_base::in)
+ {
+ const __size_type __nget = this->gptr() - this->eback();
+ const __size_type __eget = this->egptr() - this->eback();
+ this->setg(__base, __base + __nget, __base + __eget + 1);
+ }
+ *this->pptr() = traits_type::to_char_type(__c);
+ this->pbump(1);
+ return __c;
+ }
+#endif
+
const __size_type __max_size = _M_string.max_size();
const bool __testput = this->pptr() < this->epptr();
if (__builtin_expect(!__testput && __capacity == __max_size, false))
@@ -110,7 +129,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const __size_type __opt_len = std::max(__size_type(2 * __capacity),
__size_type(512));
const __size_type __len = std::min(__opt_len, __max_size);
- __string_type __tmp;
+ __string_type __tmp(_M_string.get_allocator());
__tmp.reserve(__len);
if (this->pbase())
__tmp.assign(this->pbase(), this->epptr() - this->pbase());
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 246193f38c7..ea413b1b155 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -3857,8 +3857,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif // C++11
-_GLIBCXX_END_NAMESPACE_VERSION
-
_GLIBCXX_BEGIN_NAMESPACE_ALGO
/**
@@ -5831,13 +5829,15 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
"sample size must be an integer type");
typename iterator_traits<_PopulationIterator>::difference_type __d = __n;
- return std::__sample(__first, __last, __pop_cat{}, __out, __samp_cat{},
- __d, std::forward<_UniformRandomBitGenerator>(__g));
+ return _GLIBCXX_STD_A::
+ __sample(__first, __last, __pop_cat{}, __out, __samp_cat{}, __d,
+ std::forward<_UniformRandomBitGenerator>(__g));
}
#endif // C++17
#endif // C++14
_GLIBCXX_END_NAMESPACE_ALGO
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _STL_ALGO_H */
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 0a49e6ff66c..f68ecb22b82 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -1020,8 +1020,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__lg(unsigned long long __n)
{ return sizeof(long long) * __CHAR_BIT__ - 1 - __builtin_clzll(__n); }
-_GLIBCXX_END_NAMESPACE_VERSION
-
_GLIBCXX_BEGIN_NAMESPACE_ALGO
/**
@@ -1411,6 +1409,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
#endif
_GLIBCXX_END_NAMESPACE_ALGO
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
// NB: This file is included within many other C++ includes, as a way
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index bf4b23eb2d3..d24e760d01b 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -62,6 +62,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
typedef unsigned long _Bit_type;
@@ -552,6 +553,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
};
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
// Declare a partial specialization of vector<T, Alloc>.
@@ -559,6 +561,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/**
@@ -1305,6 +1308,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
};
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#if __cplusplus >= 201103L
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index e03e7f5808f..48b2bc7f5eb 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -67,6 +67,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/**
@@ -2325,6 +2326,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
#undef _GLIBCXX_DEQUE_BUF_SIZE
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _STL_DEQUE_H */
diff --git a/libstdc++-v3/include/bits/stl_iterator.h b/libstdc++-v3/include/bits/stl_iterator.h
index 18c6e3f625e..88667a568c3 100644
--- a/libstdc++-v3/include/bits/stl_iterator.h
+++ b/libstdc++-v3/include/bits/stl_iterator.h
@@ -984,15 +984,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__niter_base(__gnu_cxx::__normal_iterator<_Iterator, _Container> __it)
{ return __it.base(); }
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
#if __cplusplus >= 201103L
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @addtogroup iterators
* @{
@@ -1243,9 +1236,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
-> decltype(__miter_base(__it.base()))
{ return __miter_base(__it.base()); }
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
#define _GLIBCXX_MAKE_MOVE_ITERATOR(_Iter) std::make_move_iterator(_Iter)
#define _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(_Iter) \
std::__make_move_if_noexcept_iterator(_Iter)
@@ -1254,6 +1244,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(_Iter) (_Iter)
#endif // C++11
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
+
#ifdef _GLIBCXX_DEBUG
# include <debug/stl_iterator.h>
#endif
diff --git a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
index e14a22ce255..86a93d34fa1 100644
--- a/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
+++ b/libstdc++-v3/include/bits/stl_iterator_base_funcs.h
@@ -66,14 +66,14 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
// Forward declaration for the overloads of __distance.
template <typename> struct _List_iterator;
template <typename> struct _List_const_iterator;
_GLIBCXX_END_NAMESPACE_CONTAINER
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _InputIterator>
inline _GLIBCXX14_CONSTEXPR
typename iterator_traits<_InputIterator>::difference_type
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 232885af79d..cef94f728ef 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -66,10 +66,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// Supporting structures are split into common and templated
// types; the latter publicly inherits from the former in an
// effort to reduce code duplication. This results in some
@@ -99,7 +99,64 @@ namespace std _GLIBCXX_VISIBILITY(default)
_M_unhook() _GLIBCXX_USE_NOEXCEPT;
};
- _GLIBCXX_END_NAMESPACE_VERSION
+ /// The %list node header.
+ struct _List_node_header : public _List_node_base
+ {
+#if _GLIBCXX_USE_CXX11_ABI
+ std::size_t _M_size;
+#endif
+
+ _List_node_header() _GLIBCXX_NOEXCEPT
+ { _M_init(); }
+
+#if __cplusplus >= 201103L
+ _List_node_header(_List_node_header&& __x) noexcept
+ : _List_node_base{ __x._M_next, __x._M_prev }
+# if _GLIBCXX_USE_CXX11_ABI
+ , _M_size(__x._M_size)
+# endif
+ {
+ if (__x._M_base()->_M_next == __x._M_base())
+ this->_M_next = this->_M_prev = this;
+ else
+ {
+ this->_M_next->_M_prev = this->_M_prev->_M_next = this->_M_base();
+ __x._M_init();
+ }
+ }
+
+ void
+ _M_move_nodes(_List_node_header&& __x)
+ {
+ _List_node_base* const __xnode = __x._M_base();
+ if (__xnode->_M_next == __xnode)
+ _M_init();
+ else
+ {
+ _List_node_base* const __node = this->_M_base();
+ __node->_M_next = __xnode->_M_next;
+ __node->_M_prev = __xnode->_M_prev;
+ __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
+# if _GLIBCXX_USE_CXX11_ABI
+ _M_size = __x._M_size;
+# endif
+ __x._M_init();
+ }
+ }
+#endif
+
+ void
+ _M_init() _GLIBCXX_NOEXCEPT
+ {
+ this->_M_next = this->_M_prev = this;
+#if _GLIBCXX_USE_CXX11_ABI
+ this->_M_size = 0;
+#endif
+ }
+
+ private:
+ _List_node_base* _M_base() { return this; }
+ };
} // namespace detail
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
@@ -323,23 +380,21 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
struct _List_impl
: public _Node_alloc_type
{
-#if _GLIBCXX_USE_CXX11_ABI
- _List_node<size_t> _M_node;
-#else
- __detail::_List_node_base _M_node;
-#endif
+ __detail::_List_node_header _M_node;
- _List_impl() _GLIBCXX_NOEXCEPT
- : _Node_alloc_type(), _M_node()
+ _List_impl() _GLIBCXX_NOEXCEPT_IF( noexcept(_Node_alloc_type()) )
+ : _Node_alloc_type()
{ }
_List_impl(const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
- : _Node_alloc_type(__a), _M_node()
+ : _Node_alloc_type(__a)
{ }
#if __cplusplus >= 201103L
+ _List_impl(_List_impl&&) = default;
+
_List_impl(_Node_alloc_type&& __a) noexcept
- : _Node_alloc_type(std::move(__a)), _M_node()
+ : _Node_alloc_type(std::move(__a))
{ }
#endif
};
@@ -347,13 +402,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
_List_impl _M_impl;
#if _GLIBCXX_USE_CXX11_ABI
- size_t _M_get_size() const { return *_M_impl._M_node._M_valptr(); }
+ size_t _M_get_size() const { return _M_impl._M_node._M_size; }
- void _M_set_size(size_t __n) { *_M_impl._M_node._M_valptr() = __n; }
+ void _M_set_size(size_t __n) { _M_impl._M_node._M_size = __n; }
- void _M_inc_size(size_t __n) { *_M_impl._M_node._M_valptr() += __n; }
+ void _M_inc_size(size_t __n) { _M_impl._M_node._M_size += __n; }
- void _M_dec_size(size_t __n) { *_M_impl._M_node._M_valptr() -= __n; }
+ void _M_dec_size(size_t __n) { _M_impl._M_node._M_size -= __n; }
size_t
_M_distance(const __detail::_List_node_base* __first,
@@ -361,7 +416,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
{ return _S_distance(__first, __last); }
// return the stored size
- size_t _M_node_count() const { return *_M_impl._M_node._M_valptr(); }
+ size_t _M_node_count() const { return _M_get_size(); }
#else
// dummy implementations used when the size is not stored
size_t _M_get_size() const { return 0; }
@@ -397,44 +452,30 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
_M_get_Node_allocator() const _GLIBCXX_NOEXCEPT
{ return _M_impl; }
- _List_base()
- : _M_impl()
- { _M_init(); }
+#if __cplusplus >= 201103L
+ _List_base() = default;
+#else
+ _List_base() { }
+#endif
_List_base(const _Node_alloc_type& __a) _GLIBCXX_NOEXCEPT
: _M_impl(__a)
- { _M_init(); }
+ { }
#if __cplusplus >= 201103L
- _List_base(_List_base&& __x) noexcept
- : _M_impl(std::move(__x._M_get_Node_allocator()))
- { _M_move_nodes(std::move(__x)); }
+ _List_base(_List_base&&) = default;
_List_base(_List_base&& __x, _Node_alloc_type&& __a)
: _M_impl(std::move(__a))
{
if (__x._M_get_Node_allocator() == _M_get_Node_allocator())
_M_move_nodes(std::move(__x));
- else
- _M_init(); // Caller must move individual elements.
+ // else caller must move individual elements.
}
void
_M_move_nodes(_List_base&& __x)
- {
- auto* const __xnode = std::__addressof(__x._M_impl._M_node);
- if (__xnode->_M_next == __xnode)
- _M_init();
- else
- {
- auto* const __node = std::__addressof(_M_impl._M_node);
- __node->_M_next = __xnode->_M_next;
- __node->_M_prev = __xnode->_M_prev;
- __node->_M_next->_M_prev = __node->_M_prev->_M_next = __node;
- _M_set_size(__x._M_get_size());
- __x._M_init();
- }
- }
+ { _M_impl._M_node._M_move_nodes(std::move(__x._M_impl._M_node)); }
#endif
// This is what actually destroys the list.
@@ -446,11 +487,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
void
_M_init() _GLIBCXX_NOEXCEPT
- {
- this->_M_impl._M_node._M_next = &this->_M_impl._M_node;
- this->_M_impl._M_node._M_prev = &this->_M_impl._M_node;
- _M_set_size(0);
- }
+ { this->_M_impl._M_node._M_init(); }
};
/**
@@ -586,11 +623,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
/**
* @brief Creates a %list with no elements.
*/
- list()
#if __cplusplus >= 201103L
- noexcept(is_nothrow_default_constructible<_Node_alloc_type>::value)
+ list() = default;
+#else
+ list() { }
#endif
- : _Base() { }
/**
* @brief Creates a %list with no elements.
@@ -657,13 +694,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
#if __cplusplus >= 201103L
/**
* @brief %List move constructor.
- * @param __x A %list of identical element and allocator types.
*
- * The newly-created %list contains the exact contents of @a __x.
- * The contents of @a __x are a valid, but unspecified %list.
+ * The newly-created %list contains the exact contents of the moved
+ * instance. The contents of the moved instance are a valid, but
+ * unspecified %list.
*/
- list(list&& __x) noexcept
- : _Base(std::move(__x)) { }
+ list(list&&) = default;
/**
* @brief Builds a %list from an initializer_list
@@ -1838,17 +1874,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
_M_move_assign(list&& __x, true_type) noexcept
{
this->_M_clear();
- if (__x.empty())
- this->_M_init();
- else
- {
- this->_M_impl._M_node._M_next = __x._M_impl._M_node._M_next;
- this->_M_impl._M_node._M_next->_M_prev = &this->_M_impl._M_node;
- this->_M_impl._M_node._M_prev = __x._M_impl._M_node._M_prev;
- this->_M_impl._M_node._M_prev->_M_next = &this->_M_impl._M_node;
- this->_M_set_size(__x._M_get_size());
- __x._M_init();
- }
+ this->_M_move_nodes(std::move(__x));
std::__alloc_on_move(this->_M_get_Node_allocator(),
__x._M_get_Node_allocator());
}
@@ -1964,7 +1990,6 @@ _GLIBCXX_END_NAMESPACE_CXX11
_GLIBCXX_END_NAMESPACE_CONTAINER
#if _GLIBCXX_USE_CXX11_ABI
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Detect when distance is used to compute the size of the whole list.
template<typename _Tp>
@@ -1983,12 +2008,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_STD_C::_List_const_iterator<_Tp> __last,
input_iterator_tag)
{
- typedef _GLIBCXX_STD_C::_List_node<size_t> _Sentinel;
+ typedef __detail::_List_node_header _Sentinel;
_GLIBCXX_STD_C::_List_const_iterator<_Tp> __beyond = __last;
++__beyond;
- bool __whole = __first == __beyond;
+ const bool __whole = __first == __beyond;
if (__builtin_constant_p (__whole) && __whole)
- return *static_cast<const _Sentinel*>(__last._M_node)->_M_valptr();
+ return static_cast<const _Sentinel*>(__last._M_node)->_M_size;
ptrdiff_t __n = 0;
while (__first != __last)
@@ -1998,9 +2023,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
return __n;
}
+#endif
_GLIBCXX_END_NAMESPACE_VERSION
-#endif
} // namespace std
#endif /* _STL_LIST_H */
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index 30339536f57..0e8a98a96c1 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -65,6 +65,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
@@ -1437,7 +1438,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_GLIBCXX_END_NAMESPACE_CONTAINER
#if __cplusplus > 201402L
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Allow std::map access to internals of compatible maps.
template<typename _Key, typename _Val, typename _Cmp1, typename _Alloc,
typename _Cmp2>
@@ -1456,9 +1456,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_get_tree(_GLIBCXX_STD_C::multimap<_Key, _Val, _Cmp2, _Alloc>& __map)
{ return __map._M_t; }
};
-_GLIBCXX_END_NAMESPACE_VERSION
#endif // C++17
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _STL_MAP_H */
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index 7dc22a96a59..7e3cea48a47 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -63,6 +63,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template <typename _Key, typename _Tp, typename _Compare, typename _Alloc>
@@ -1102,7 +1103,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_GLIBCXX_END_NAMESPACE_CONTAINER
#if __cplusplus > 201402L
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Allow std::multimap access to internals of compatible maps.
template<typename _Key, typename _Val, typename _Cmp1, typename _Alloc,
typename _Cmp2>
@@ -1121,9 +1121,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_get_tree(_GLIBCXX_STD_C::multimap<_Key, _Val, _Cmp2, _Alloc>& __map)
{ return __map._M_t; }
};
-_GLIBCXX_END_NAMESPACE_VERSION
#endif // C++17
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _STL_MULTIMAP_H */
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index 60a3db844cb..517e77e9372 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -63,6 +63,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Key, typename _Compare, typename _Alloc>
@@ -953,7 +954,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_GLIBCXX_END_NAMESPACE_CONTAINER
#if __cplusplus > 201402L
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Allow std::multiset access to internals of compatible sets.
template<typename _Val, typename _Cmp1, typename _Alloc, typename _Cmp2>
struct
@@ -971,9 +971,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_get_tree(_GLIBCXX_STD_C::multiset<_Val, _Cmp2, _Alloc>& __set)
{ return __set._M_t; }
};
-_GLIBCXX_END_NAMESPACE_VERSION
#endif // C++17
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _STL_MULTISET_H */
diff --git a/libstdc++-v3/include/bits/stl_relops.h b/libstdc++-v3/include/bits/stl_relops.h
index a2614bd3040..e2a0e25ca31 100644
--- a/libstdc++-v3/include/bits/stl_relops.h
+++ b/libstdc++-v3/include/bits/stl_relops.h
@@ -66,10 +66,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace rel_ops
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/** @namespace std::rel_ops
* @brief The generated relational operators are sequestered here.
*/
@@ -125,10 +125,9 @@ namespace std _GLIBCXX_VISIBILITY(default)
inline bool
operator>=(const _Tp& __x, const _Tp& __y)
{ return !(__x < __y); }
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace rel_ops
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _STL_RELOPS_H */
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index 817bc2d870f..e804a7cae70 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -63,6 +63,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Key, typename _Compare, typename _Alloc>
@@ -969,7 +970,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_GLIBCXX_END_NAMESPACE_CONTAINER
#if __cplusplus > 201402L
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Allow std::set access to internals of compatible sets.
template<typename _Val, typename _Cmp1, typename _Alloc, typename _Cmp2>
struct
@@ -986,8 +986,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_get_tree(_GLIBCXX_STD_C::multiset<_Val, _Cmp2, _Alloc>& __set)
{ return __set._M_t; }
};
-_GLIBCXX_END_NAMESPACE_VERSION
#endif // C++17
+_GLIBCXX_END_NAMESPACE_VERSION
} //namespace std
#endif /* _STL_SET_H */
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index 7ee3ce96890..69cb8030208 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -65,8 +65,15 @@
#include <debug/assertions.h>
+#if _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
+extern "C" void
+__sanitizer_annotate_contiguous_container(const void*, const void*,
+ const void*, const void*);
+#endif
+
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// See bits/stl_deque.h's _Deque_base for an explanation.
@@ -106,6 +113,121 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
std::swap(_M_finish, __x._M_finish);
std::swap(_M_end_of_storage, __x._M_end_of_storage);
}
+
+#if _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
+ template<typename = _Tp_alloc_type>
+ struct _Asan
+ {
+ typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
+ ::size_type size_type;
+
+ static void _S_shrink(_Vector_impl&, size_type) { }
+ static void _S_on_dealloc(_Vector_impl&) { }
+
+ typedef _Vector_impl& _Reinit;
+
+ struct _Grow
+ {
+ _Grow(_Vector_impl&, size_type) { }
+ void _M_grew(size_type) { }
+ };
+ };
+
+ // Enable ASan annotations for memory obtained from std::allocator.
+ template<typename _Up>
+ struct _Asan<allocator<_Up> >
+ {
+ typedef typename __gnu_cxx::__alloc_traits<_Tp_alloc_type>
+ ::size_type size_type;
+
+ // Adjust ASan annotation for [_M_start, _M_end_of_storage) to
+ // mark end of valid region as __curr instead of __prev.
+ static void
+ _S_adjust(_Vector_impl& __impl, pointer __prev, pointer __curr)
+ {
+ __sanitizer_annotate_contiguous_container(__impl._M_start,
+ __impl._M_end_of_storage, __prev, __curr);
+ }
+
+ static void
+ _S_grow(_Vector_impl& __impl, size_type __n)
+ { _S_adjust(__impl, __impl._M_finish, __impl._M_finish + __n); }
+
+ static void
+ _S_shrink(_Vector_impl& __impl, size_type __n)
+ { _S_adjust(__impl, __impl._M_finish + __n, __impl._M_finish); }
+
+ static void
+ _S_on_dealloc(_Vector_impl& __impl)
+ {
+ if (__impl._M_start)
+ _S_adjust(__impl, __impl._M_finish, __impl._M_end_of_storage);
+ }
+
+ // Used on reallocation to tell ASan unused capacity is invalid.
+ struct _Reinit
+ {
+ explicit _Reinit(_Vector_impl& __impl) : _M_impl(__impl)
+ {
+ // Mark unused capacity as valid again before deallocating it.
+ _S_on_dealloc(_M_impl);
+ }
+
+ ~_Reinit()
+ {
+ // Mark unused capacity as invalid after reallocation.
+ if (_M_impl._M_start)
+ _S_adjust(_M_impl, _M_impl._M_end_of_storage,
+ _M_impl._M_finish);
+ }
+
+ _Vector_impl& _M_impl;
+
+#if __cplusplus >= 201103L
+ _Reinit(const _Reinit&) = delete;
+ _Reinit& operator=(const _Reinit&) = delete;
+#endif
+ };
+
+ // Tell ASan when unused capacity is initialized to be valid.
+ struct _Grow
+ {
+ _Grow(_Vector_impl& __impl, size_type __n)
+ : _M_impl(__impl), _M_n(__n)
+ { _S_grow(_M_impl, __n); }
+
+ ~_Grow() { if (_M_n) _S_shrink(_M_impl, _M_n); }
+
+ void _M_grew(size_type __n) { _M_n -= __n; }
+
+#if __cplusplus >= 201103L
+ _Grow(const _Grow&) = delete;
+ _Grow& operator=(const _Grow&) = delete;
+#endif
+ private:
+ _Vector_impl& _M_impl;
+ size_type _M_n;
+ };
+ };
+
+#define _GLIBCXX_ASAN_ANNOTATE_REINIT \
+ typename _Base::_Vector_impl::template _Asan<>::_Reinit const \
+ __attribute__((__unused__)) __reinit_guard(this->_M_impl)
+#define _GLIBCXX_ASAN_ANNOTATE_GROW(n) \
+ typename _Base::_Vector_impl::template _Asan<>::_Grow \
+ __attribute__((__unused__)) __grow_guard(this->_M_impl, (n))
+#define _GLIBCXX_ASAN_ANNOTATE_GREW(n) __grow_guard._M_grew(n)
+#define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n) \
+ _Base::_Vector_impl::template _Asan<>::_S_shrink(this->_M_impl, n)
+#define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC \
+ _Base::_Vector_impl::template _Asan<>::_S_on_dealloc(this->_M_impl)
+#else // ! (_GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR)
+#define _GLIBCXX_ASAN_ANNOTATE_REINIT
+#define _GLIBCXX_ASAN_ANNOTATE_GROW(n)
+#define _GLIBCXX_ASAN_ANNOTATE_GREW(n)
+#define _GLIBCXX_ASAN_ANNOTATE_SHRINK(n)
+#define _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC
+#endif // _GLIBCXX_SANITIZE_STD_ALLOCATOR && _GLIBCXX_SANITIZE_VECTOR
};
public:
@@ -159,8 +281,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
#endif
~_Vector_base() _GLIBCXX_NOEXCEPT
- { _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
- - this->_M_impl._M_start); }
+ {
+ _M_deallocate(_M_impl._M_start,
+ _M_impl._M_end_of_storage - _M_impl._M_start);
+ }
public:
_Vector_impl _M_impl;
@@ -190,7 +314,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
};
-
/**
* @brief A standard container which offers fixed time access to
* individual elements in any order.
@@ -431,8 +554,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
* responsibility.
*/
~vector() _GLIBCXX_NOEXCEPT
- { std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
- _M_get_Tp_allocator()); }
+ {
+ std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ _GLIBCXX_ASAN_ANNOTATE_BEFORE_DEALLOC;
+ }
/**
* @brief %Vector assignment operator.
@@ -940,9 +1066,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(1);
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
__x);
++this->_M_impl._M_finish;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(1);
}
else
_M_realloc_insert(end(), __x);
@@ -977,6 +1105,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
__glibcxx_requires_nonempty();
--this->_M_impl._M_finish;
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
+ _GLIBCXX_ASAN_ANNOTATE_SHRINK(1);
}
#if __cplusplus >= 201103L
@@ -1510,8 +1639,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
void
_M_erase_at_end(pointer __pos) _GLIBCXX_NOEXCEPT
{
- std::_Destroy(__pos, this->_M_impl._M_finish, _M_get_Tp_allocator());
- this->_M_impl._M_finish = __pos;
+ if (size_type __n = this->_M_impl._M_finish - __pos)
+ {
+ std::_Destroy(__pos, this->_M_impl._M_finish,
+ _M_get_Tp_allocator());
+ this->_M_impl._M_finish = __pos;
+ _GLIBCXX_ASAN_ANNOTATE_SHRINK(__n);
+ }
}
iterator
@@ -1655,6 +1789,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{ __x.swap(__y); }
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _STL_VECTOR_H */
diff --git a/libstdc++-v3/include/bits/uniform_int_dist.h b/libstdc++-v3/include/bits/uniform_int_dist.h
index af7ac14bccf..16509c4ef8a 100644
--- a/libstdc++-v3/include/bits/uniform_int_dist.h
+++ b/libstdc++-v3/include/bits/uniform_int_dist.h
@@ -36,10 +36,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
/* Determine whether number is a power of 2. */
template<typename _Tp>
inline bool
@@ -47,11 +47,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
return ((__x - 1) & __x) == 0;
};
-_GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief Uniform discrete distribution for random numbers.
* A discrete random distribution on the range @f$[min, max]@f$ with equal
diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index 4ef30ccccd6..df1302c80c0 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -32,6 +32,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Base types for unordered_map.
@@ -1911,7 +1912,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_GLIBCXX_END_NAMESPACE_CONTAINER
#if __cplusplus > 201402L
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Allow std::unordered_map access to internals of compatible maps.
template<typename _Key, typename _Val, typename _Hash1, typename _Eq1,
typename _Alloc, typename _Hash2, typename _Eq2>
@@ -1959,9 +1959,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_get_table(unordered_multimap<_Key, _Val, _Hash2, _Eq2, _Alloc>& __map)
{ return __map._M_h; }
};
-_GLIBCXX_END_NAMESPACE_VERSION
#endif // C++17
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _UNORDERED_MAP_H */
diff --git a/libstdc++-v3/include/bits/unordered_set.h b/libstdc++-v3/include/bits/unordered_set.h
index 85c2562f89e..df57915f31a 100644
--- a/libstdc++-v3/include/bits/unordered_set.h
+++ b/libstdc++-v3/include/bits/unordered_set.h
@@ -32,6 +32,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
/// Base types for unordered_set.
@@ -1557,7 +1558,6 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_GLIBCXX_END_NAMESPACE_CONTAINER
#if __cplusplus > 201402L
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Allow std::unordered_set access to internals of compatible sets.
template<typename _Val, typename _Hash1, typename _Eq1, typename _Alloc,
typename _Hash2, typename _Eq2>
@@ -1604,9 +1604,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_S_get_table(unordered_multiset<_Val, _Hash2, _Eq2, _Alloc>& __set)
{ return __set._M_h; }
};
-_GLIBCXX_END_NAMESPACE_VERSION
#endif // C++17
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _UNORDERED_SET_H */
diff --git a/libstdc++-v3/include/bits/uses_allocator.h b/libstdc++-v3/include/bits/uses_allocator.h
index 89d4e435659..4d60716b494 100644
--- a/libstdc++-v3/include/bits/uses_allocator.h
+++ b/libstdc++-v3/include/bits/uses_allocator.h
@@ -109,6 +109,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__ret._M_a = std::__addressof(__a);
return __ret;
}
+
+ template<typename _Tp, typename _Alloc, typename... _Args>
+ void
+ __use_alloc(const _Alloc&&) = delete;
+
#if __cplusplus > 201402L
template <typename _Tp, typename _Alloc>
inline constexpr bool uses_allocator_v =
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index 8d688661c82..f14caaa713f 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -58,6 +58,7 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CONTAINER
template<typename _Tp, typename _Alloc>
@@ -73,6 +74,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
pointer __tmp = _M_allocate_and_copy(__n,
_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(this->_M_impl._M_start),
_GLIBCXX_MAKE_MOVE_IF_NOEXCEPT_ITERATOR(this->_M_impl._M_finish));
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
@@ -97,9 +99,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(1);
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
std::forward<_Args>(__args)...);
++this->_M_impl._M_finish;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(1);
}
else
_M_realloc_insert(end(), std::forward<_Args>(__args)...);
@@ -122,9 +126,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
if (__position == end())
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(1);
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
__x);
++this->_M_impl._M_finish;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(1);
}
else
{
@@ -157,6 +163,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_GLIBCXX_MOVE3(__position + 1, end(), __position);
--this->_M_impl._M_finish;
_Alloc_traits::destroy(this->_M_impl, this->_M_impl._M_finish);
+ _GLIBCXX_ASAN_ANNOTATE_SHRINK(1);
return __position;
}
@@ -181,6 +188,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{
if (&__x != this)
{
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
#if __cplusplus >= 201103L
if (_Alloc_traits::_S_propagate_on_copy_assign())
{
@@ -245,10 +253,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
else if (__n > size())
{
std::fill(begin(), end(), __val);
+ const size_type __add = __n - size();
+ _GLIBCXX_ASAN_ANNOTATE_GROW(__add);
this->_M_impl._M_finish =
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
- __n - size(), __val,
- _M_get_Tp_allocator());
+ __add, __val, _M_get_Tp_allocator());
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__add);
}
else
_M_erase_at_end(std::fill_n(this->_M_impl._M_start, __n, __val));
@@ -284,6 +294,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
if (__len > capacity())
{
pointer __tmp(_M_allocate_and_copy(__len, __first, __last));
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
@@ -300,10 +311,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_ForwardIterator __mid = __first;
std::advance(__mid, size());
std::copy(__first, __mid, this->_M_impl._M_start);
+ const size_type __attribute__((__unused__)) __n = __len - size();
+ _GLIBCXX_ASAN_ANNOTATE_GROW(__n);
this->_M_impl._M_finish =
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__n);
}
}
@@ -317,9 +331,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
if (__position == cend())
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(1);
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
std::move(__v));
++this->_M_impl._M_finish;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(1);
}
else
_M_insert_aux(begin() + __n, std::move(__v));
@@ -340,9 +356,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
if (__position == cend())
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(1);
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
std::forward<_Args>(__args)...);
++this->_M_impl._M_finish;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(1);
}
else
{
@@ -370,10 +388,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_insert_aux(iterator __position, const _Tp& __x)
#endif
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(1);
_Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
- _GLIBCXX_MOVE(*(this->_M_impl._M_finish
- - 1)));
+ _GLIBCXX_MOVE(*(this->_M_impl._M_finish - 1)));
++this->_M_impl._M_finish;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(1);
#if __cplusplus < 201103L
_Tp __x_copy = __x;
#endif
@@ -443,11 +462,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
- this->_M_impl._M_end_of_storage
- - this->_M_impl._M_start);
+ this->_M_impl._M_end_of_storage - this->_M_impl._M_start);
this->_M_impl._M_start = __new_start;
this->_M_impl._M_finish = __new_finish;
this->_M_impl._M_end_of_storage = __new_start + __len;
@@ -473,11 +492,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
pointer __old_finish(this->_M_impl._M_finish);
if (__elems_after > __n)
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(__n);
std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__n);
_GLIBCXX_MOVE_BACKWARD3(__position.base(),
__old_finish - __n, __old_finish);
std::fill(__position.base(), __position.base() + __n,
@@ -485,15 +506,18 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
}
else
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(__n);
this->_M_impl._M_finish =
std::__uninitialized_fill_n_a(this->_M_impl._M_finish,
__n - __elems_after,
__x_copy,
_M_get_Tp_allocator());
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__n - __elems_after);
std::__uninitialized_move_a(__position.base(), __old_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __elems_after;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__elems_after);
std::fill(__position.base(), __old_finish, __x_copy);
}
}
@@ -536,6 +560,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
@@ -559,9 +584,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
if (size_type(this->_M_impl._M_end_of_storage
- this->_M_impl._M_finish) >= __n)
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(__n);
this->_M_impl._M_finish =
std::__uninitialized_default_n_a(this->_M_impl._M_finish,
__n, _M_get_Tp_allocator());
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__n);
}
else
{
@@ -587,6 +614,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
@@ -606,6 +634,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{
if (capacity() == size())
return false;
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
return std::__shrink_to_fit_aux<vector>::_S_do_it(*this);
}
#endif
@@ -617,10 +646,17 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_range_insert(iterator __pos, _InputIterator __first,
_InputIterator __last, std::input_iterator_tag)
{
- for (; __first != __last; ++__first)
+ if (__pos == end())
+ {
+ for (; __first != __last; ++__first)
+ insert(end(), *__first);
+ }
+ else if (__first != __last)
{
- __pos = insert(__pos, *__first);
- ++__pos;
+ vector __tmp(__first, __last, _M_get_Tp_allocator());
+ insert(__pos,
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__tmp.begin()),
+ _GLIBCXX_MAKE_MOVE_ITERATOR(__tmp.end()));
}
}
@@ -641,11 +677,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
pointer __old_finish(this->_M_impl._M_finish);
if (__elems_after > __n)
{
+ _GLIBCXX_ASAN_ANNOTATE_GROW(__n);
std::__uninitialized_move_a(this->_M_impl._M_finish - __n,
this->_M_impl._M_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__n);
_GLIBCXX_MOVE_BACKWARD3(__position.base(),
__old_finish - __n, __old_finish);
std::copy(__first, __last, __position);
@@ -654,15 +692,18 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
{
_ForwardIterator __mid = __first;
std::advance(__mid, __elems_after);
+ _GLIBCXX_ASAN_ANNOTATE_GROW(__n);
std::__uninitialized_copy_a(__mid, __last,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __n - __elems_after;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__n - __elems_after);
std::__uninitialized_move_a(__position.base(),
__old_finish,
this->_M_impl._M_finish,
_M_get_Tp_allocator());
this->_M_impl._M_finish += __elems_after;
+ _GLIBCXX_ASAN_ANNOTATE_GREW(__elems_after);
std::copy(__first, __mid, __position);
}
}
@@ -694,6 +735,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_M_deallocate(__new_start, __len);
__throw_exception_again;
}
+ _GLIBCXX_ASAN_ANNOTATE_REINIT;
std::_Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
_M_get_Tp_allocator());
_M_deallocate(this->_M_impl._M_start,
@@ -856,6 +898,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
#endif
_GLIBCXX_END_NAMESPACE_CONTAINER
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#if __cplusplus >= 201103L
@@ -902,4 +945,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
#endif // C++11
+#undef _GLIBCXX_ASAN_ANNOTATE_REINIT
+#undef _GLIBCXX_ASAN_ANNOTATE_GROW
+#undef _GLIBCXX_ASAN_ANNOTATE_GREW
+#undef _GLIBCXX_ASAN_ANNOTATE_SHRINK
+
#endif /* _VECTOR_TCC */
diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath
index 6e7508f6939..71f70ce6b73 100644
--- a/libstdc++-v3/include/c_global/cmath
+++ b/libstdc++-v3/include/c_global/cmath
@@ -513,9 +513,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tanh(_Tp __x)
{ return __builtin_tanh(__x); }
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
#if _GLIBCXX_USE_C99_MATH
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
@@ -533,10 +530,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
#undef islessgreater
#undef isunordered
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#if __cplusplus >= 201103L
#ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO_FP
@@ -952,13 +945,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_isunordered(__type(__f1), __type(__f2));
}
-#endif
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
+#endif // C++11
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
-#endif
+#endif /* _GLIBCXX_USE_C99_MATH */
#if __cplusplus >= 201103L
@@ -1072,10 +1061,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
#undef truncf
#undef truncl
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// types
using ::double_t;
using ::float_t;
@@ -1856,17 +1841,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return __builtin_trunc(__x); }
#endif
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
#endif // _GLIBCXX_USE_C99_MATH_TR1
-
#endif // C++11
#if __cplusplus > 201402L
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// [c.math.hypot3], three-dimensional hypotenuse
#define __cpp_lib_hypot 201603
@@ -1905,10 +1883,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using __type = typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type;
return std::__hypot3<__type>(__x, __y, __z);
}
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
#endif // C++17
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# include <bits/specfun.h>
diff --git a/libstdc++-v3/include/c_std/cmath b/libstdc++-v3/include/c_std/cmath
index c5b5a470f87..8fc5736601d 100644
--- a/libstdc++-v3/include/c_std/cmath
+++ b/libstdc++-v3/include/c_std/cmath
@@ -449,9 +449,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tanh(_Tp __x)
{ return __builtin_tanh(__x); }
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
#if _GLIBCXX_USE_C99_MATH
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
@@ -469,10 +466,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
#undef islessgreater
#undef isunordered
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Tp>
inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
int>::__type
@@ -582,10 +575,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __builtin_isunordered(__type(__f1), __type(__f2));
}
+#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
+#endif /* _GLIBCXX_USE_C99_MATH */
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
-#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
-#endif
-
#endif
diff --git a/libstdc++-v3/include/decimal/decimal b/libstdc++-v3/include/decimal/decimal
index b167a7ac7f2..adc4619d944 100644
--- a/libstdc++-v3/include/decimal/decimal
+++ b/libstdc++-v3/include/decimal/decimal
@@ -42,6 +42,8 @@ that is currently not available.
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
/**
* @defgroup decimal Decimal Floating-Point Arithmetic
* @ingroup numerics
@@ -55,8 +57,6 @@ namespace std _GLIBCXX_VISIBILITY(default)
*/
namespace decimal
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
class decimal32;
class decimal64;
class decimal128;
@@ -483,10 +483,10 @@ namespace decimal
};
#define _GLIBCXX_USE_DECIMAL_ 1
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace decimal
// @} group decimal
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#include <decimal/decimal.h>
diff --git a/libstdc++-v3/include/decimal/decimal.h b/libstdc++-v3/include/decimal/decimal.h
index ede6e57c998..d4118962614 100644
--- a/libstdc++-v3/include/decimal/decimal.h
+++ b/libstdc++-v3/include/decimal/decimal.h
@@ -37,10 +37,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace decimal
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// ISO/IEC TR 24733 3.2.[234].1 Construct/copy/destroy.
inline decimal32::decimal32(decimal64 __r) : __val(__r.__getval()) {}
@@ -461,8 +461,9 @@ namespace decimal
#undef _DEFINE_DECIMAL_COMPARISON_LHS
#undef _DEFINE_DECIMAL_COMPARISON_RHS
#undef _DEFINE_DECIMAL_COMPARISONS
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace decimal
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif /* _GLIBCXX_DECIMAL_IMPL */
diff --git a/libstdc++-v3/include/experimental/algorithm b/libstdc++-v3/include/experimental/algorithm
index a7ab0e84c12..15391b1e9f2 100644
--- a/libstdc++-v3/include/experimental/algorithm
+++ b/libstdc++-v3/include/experimental/algorithm
@@ -40,12 +40,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _ForwardIterator, typename _Searcher>
inline _ForwardIterator
search(_ForwardIterator __first, _ForwardIterator __last,
@@ -81,10 +81,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__d,
std::forward<_UniformRandomNumberGenerator>(__g));
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/any b/libstdc++-v3/include/experimental/any
index 36c0680c25a..984306dfce8 100644
--- a/libstdc++-v3/include/experimental/any
+++ b/libstdc++-v3/include/experimental/any
@@ -43,12 +43,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @defgroup any Type-safe container of any type
* @ingroup experimental
@@ -520,9 +520,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// @} group any
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/array b/libstdc++-v3/include/experimental/array
index 11cb924e087..9d758f7d149 100644
--- a/libstdc++-v3/include/experimental/array
+++ b/libstdc++-v3/include/experimental/array
@@ -40,12 +40,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_make_array 201505
/**
* @defgroup make_array Array creation functions
@@ -104,10 +104,10 @@ template <typename _Tp, size_t _Nm>
}
// @} group make_array
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/bits/erase_if.h b/libstdc++-v3/include/experimental/bits/erase_if.h
index 7dc47dbb3eb..cc89ffad900 100644
--- a/libstdc++-v3/include/experimental/bits/erase_if.h
+++ b/libstdc++-v3/include/experimental/bits/erase_if.h
@@ -39,13 +39,14 @@
namespace std
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Container, typename _Predicate>
void
__erase_nodes_if(_Container& __cont, _Predicate __pred)
@@ -59,10 +60,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
++__iter;
}
}
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
} // inline namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/bits/fs_dir.h b/libstdc++-v3/include/experimental/bits/fs_dir.h
index 0efaf944f60..1ff0d9b6def 100644
--- a/libstdc++-v3/include/experimental/bits/fs_dir.h
+++ b/libstdc++-v3/include/experimental/bits/fs_dir.h
@@ -40,14 +40,14 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
namespace filesystem
{
inline namespace v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @ingroup filesystem
* @{
@@ -352,10 +352,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
_GLIBCXX_END_NAMESPACE_CXX11
// @} group filesystem
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace v1
} // namespace filesystem
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/experimental/bits/fs_fwd.h b/libstdc++-v3/include/experimental/bits/fs_fwd.h
index c5aeefe41a7..7b851a3d4a8 100644
--- a/libstdc++-v3/include/experimental/bits/fs_fwd.h
+++ b/libstdc++-v3/include/experimental/bits/fs_fwd.h
@@ -40,17 +40,14 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
namespace filesystem
{
inline namespace v1
{
-#if _GLIBCXX_INLINE_VERSION
-inline namespace __8 { }
-#endif
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#if _GLIBCXX_USE_CXX11_ABI
inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { }
#endif
@@ -282,10 +279,11 @@ _GLIBCXX_END_NAMESPACE_CXX11
bool is_symlink(file_status) noexcept;
// @} group filesystem
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace v1
} // namespace filesystem
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/experimental/bits/fs_ops.h b/libstdc++-v3/include/experimental/bits/fs_ops.h
index 1b455f541ba..387537260e0 100644
--- a/libstdc++-v3/include/experimental/bits/fs_ops.h
+++ b/libstdc++-v3/include/experimental/bits/fs_ops.h
@@ -38,14 +38,14 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
namespace filesystem
{
inline namespace v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @ingroup filesystem
* @{
@@ -286,10 +286,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
path temp_directory_path(error_code& __ec);
// @} group filesystem
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace v1
} // namespace filesystem
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h
index 3d639447254..cde3897b8e5 100644
--- a/libstdc++-v3/include/experimental/bits/fs_path.h
+++ b/libstdc++-v3/include/experimental/bits/fs_path.h
@@ -55,13 +55,14 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
namespace filesystem
{
inline namespace v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CXX11
#if __cplusplus == 201402L
@@ -1080,10 +1081,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
// @} group filesystem
_GLIBCXX_END_NAMESPACE_CXX11
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace v1
} // namespace filesystem
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/experimental/bits/lfts_config.h b/libstdc++-v3/include/experimental/bits/lfts_config.h
index ecc40c4327f..3b832706da0 100644
--- a/libstdc++-v3/include/experimental/bits/lfts_config.h
+++ b/libstdc++-v3/include/experimental/bits/lfts_config.h
@@ -35,30 +35,25 @@
#if _GLIBCXX_INLINE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace chrono
{
namespace experimental
{
-inline namespace fundamentals_v1 { inline namespace __8 { } }
-inline namespace fundamentals_v2 { inline namespace __8 { } }
+inline namespace fundamentals_v1 { }
+inline namespace fundamentals_v2 { }
} // namespace experimental
} // namespace chrono
namespace experimental
{
-inline namespace fundamentals_v1 {
- inline namespace __8 { }
- namespace __detail { inline namespace __8 { } }
-}
-inline namespace fundamentals_v2 {
- inline namespace __8 { }
- namespace pmr { inline namespace __8 { } }
- namespace __detail { inline namespace __8 { } }
-} // namespace fundamentals_v2
-inline namespace literals { inline namespace string_view_literals {
- inline namespace __8 { }
-} } // namespace literals::string_view_literals
+inline namespace fundamentals_v1 { }
+inline namespace fundamentals_v2 { }
+inline namespace literals { inline namespace string_view_literals { } }
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif
#endif
diff --git a/libstdc++-v3/include/experimental/bits/shared_ptr.h b/libstdc++-v3/include/experimental/bits/shared_ptr.h
index 27f22d23618..ef391eb641f 100644
--- a/libstdc++-v3/include/experimental/bits/shared_ptr.h
+++ b/libstdc++-v3/include/experimental/bits/shared_ptr.h
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// 8.2.1
template<typename _Tp> class shared_ptr;
@@ -659,13 +659,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
mutable weak_ptr<_Tp> _M_weak_this;
};
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/// std::hash specialization for shared_ptr.
template<typename _Tp>
struct hash<experimental::shared_ptr<_Tp>>
diff --git a/libstdc++-v3/include/experimental/bits/string_view.tcc b/libstdc++-v3/include/experimental/bits/string_view.tcc
index 03863d0a9df..e66932d1ac0 100644
--- a/libstdc++-v3/include/experimental/bits/string_view.tcc
+++ b/libstdc++-v3/include/experimental/bits/string_view.tcc
@@ -42,12 +42,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _CharT, typename _Traits>
typename basic_string_view<_CharT, _Traits>::size_type
basic_string_view<_CharT, _Traits>::
@@ -222,10 +222,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
return npos;
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/chrono b/libstdc++-v3/include/experimental/chrono
index 4247c9df746..71e36d2d86d 100644
--- a/libstdc++-v3/include/experimental/chrono
+++ b/libstdc++-v3/include/experimental/chrono
@@ -44,20 +44,21 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace chrono {
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// See C++14 §20.12.4, customization traits
template <typename _Rep>
constexpr bool treat_as_floating_point_v =
treat_as_floating_point<_Rep>::value;
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
} // namespace chrono
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/deque b/libstdc++-v3/include/experimental/deque
index c92476f915d..0180a750883 100644
--- a/libstdc++-v3/include/experimental/deque
+++ b/libstdc++-v3/include/experimental/deque
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Tp, typename _Alloc, typename _Predicate>
void
erase_if(deque<_Tp, _Alloc>& __cont, _Predicate __pred)
@@ -63,19 +63,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__cont.end());
}
-_GLIBCXX_END_NAMESPACE_VERSION
-
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template<typename _Tp>
- using deque = std::deque<_Tp, polymorphic_allocator<_Tp>>;
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
+ namespace pmr {
+ template<typename _Tp>
+ using deque = std::deque<_Tp, polymorphic_allocator<_Tp>>;
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/filesystem b/libstdc++-v3/include/experimental/filesystem
index 2f353693dbe..7953c802cd3 100644
--- a/libstdc++-v3/include/experimental/filesystem
+++ b/libstdc++-v3/include/experimental/filesystem
@@ -44,14 +44,14 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
namespace filesystem
{
inline namespace v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @ingroup filesystem
*/
@@ -65,11 +65,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__what += " [" + _M_path2.string() + ']';
return __what;
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace v1
} // namespace filesystem
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++11
diff --git a/libstdc++-v3/include/experimental/forward_list b/libstdc++-v3/include/experimental/forward_list
index 1c835aca07e..5109cb57ade 100644
--- a/libstdc++-v3/include/experimental/forward_list
+++ b/libstdc++-v3/include/experimental/forward_list
@@ -40,12 +40,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Tp, typename _Alloc, typename _Predicate>
inline void
erase_if(forward_list<_Tp, _Alloc>& __cont, _Predicate __pred)
@@ -59,19 +59,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erase_if(__cont, [&](__elem_type& __elem) { return __elem == __value; });
}
-_GLIBCXX_END_NAMESPACE_VERSION
-
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template<typename _Tp>
- using forward_list = std::forward_list<_Tp, polymorphic_allocator<_Tp>>;
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
+ namespace pmr {
+ template<typename _Tp>
+ using forward_list = std::forward_list<_Tp, polymorphic_allocator<_Tp>>;
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/functional b/libstdc++-v3/include/experimental/functional
index 4639e6f6cb3..3327399b4d4 100644
--- a/libstdc++-v3/include/experimental/functional
+++ b/libstdc++-v3/include/experimental/functional
@@ -49,12 +49,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// See C++14 §20.9.9, Function object binders
/// Variable template for std::is_bind_expression
@@ -368,14 +368,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
return __last;
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_not_fn 201406
/// [func.not_fn] Function template not_fn
@@ -386,10 +382,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
return std::_Not_fn<std::decay_t<_Fn>>{std::forward<_Fn>(__fn), 0};
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/iterator b/libstdc++-v3/include/experimental/iterator
index 8a8395da759..553009c92b0 100644
--- a/libstdc++-v3/include/experimental/iterator
+++ b/libstdc++-v3/include/experimental/iterator
@@ -45,12 +45,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_ostream_joiner 201411
/// Output iterator that inserts a delimiter between elements.
@@ -105,10 +105,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os,
_DelimT&& __delimiter)
{ return { __os, std::forward<_DelimT>(__delimiter) }; }
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/list b/libstdc++-v3/include/experimental/list
index 9409431c4d8..94663ad030a 100644
--- a/libstdc++-v3/include/experimental/list
+++ b/libstdc++-v3/include/experimental/list
@@ -40,12 +40,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Tp, typename _Alloc, typename _Predicate>
inline void
erase_if(list<_Tp, _Alloc>& __cont, _Predicate __pred)
@@ -59,19 +59,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erase_if(__cont, [&](__elem_type& __elem) { return __elem == __value; });
}
-_GLIBCXX_END_NAMESPACE_VERSION
-
namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Tp>
using list = std::list<_Tp, polymorphic_allocator<_Tp>>;
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/map b/libstdc++-v3/include/experimental/map
index 2bbc1bd5a11..85055967fa5 100644
--- a/libstdc++-v3/include/experimental/map
+++ b/libstdc++-v3/include/experimental/map
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Key, typename _Tp, typename _Compare, typename _Alloc,
typename _Predicate>
inline void
@@ -59,26 +59,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erase_if(multimap<_Key, _Tp, _Compare, _Alloc>& __cont, _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); }
-_GLIBCXX_END_NAMESPACE_VERSION
-
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template<typename _Key, typename _Tp, typename _Compare = less<_Key>>
- using map
+ namespace pmr {
+ template<typename _Key, typename _Tp, typename _Compare = less<_Key>>
+ using map
= std::map<_Key, _Tp, _Compare,
polymorphic_allocator<pair<const _Key, _Tp>>>;
- template<typename _Key, typename _Tp, typename _Compare = less<_Key>>
- using multimap
+ template<typename _Key, typename _Tp, typename _Compare = less<_Key>>
+ using multimap
= std::multimap<_Key, _Tp, _Compare,
polymorphic_allocator<pair<const _Key, _Tp>>>;
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
-
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/memory b/libstdc++-v3/include/experimental/memory
index 7467674db81..33a154bf50c 100644
--- a/libstdc++-v3/include/experimental/memory
+++ b/libstdc++-v3/include/experimental/memory
@@ -47,12 +47,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_observer_ptr 201411
template <typename _Tp>
@@ -231,8 +231,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
return !(__p1 < __p2);
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
@@ -250,6 +248,8 @@ template <typename _Tp>
}
};
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/memory_resource b/libstdc++-v3/include/experimental/memory_resource
index 653189c1079..f4ecc5ab1d3 100644
--- a/libstdc++-v3/include/experimental/memory_resource
+++ b/libstdc++-v3/include/experimental/memory_resource
@@ -37,11 +37,11 @@
#include <experimental/bits/lfts_config.h>
namespace std {
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental {
inline namespace fundamentals_v2 {
namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_memory_resources 201402L
class memory_resource;
@@ -168,8 +168,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template <typename _Tp1, typename... _Args> //used here
void construct(_Tp1* __p, _Args&&... __args)
{
- auto __use_tag = __use_alloc<_Tp1, memory_resource*,
- _Args...>(this->resource());
+ memory_resource* const __resource = this->resource();
+ auto __use_tag
+ = __use_alloc<_Tp1, memory_resource*, _Args...>(__resource);
_M_construct(__use_tag, __p, std::forward<_Args>(__args)...);
}
@@ -180,10 +181,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
tuple<_Args1...> __x,
tuple<_Args2...> __y)
{
+ memory_resource* const __resource = this->resource();
auto __x_use_tag =
- __use_alloc<_Tp1, memory_resource*, _Args1...>(this->resource());
+ __use_alloc<_Tp1, memory_resource*, _Args1...>(__resource);
auto __y_use_tag =
- __use_alloc<_Tp2, memory_resource*, _Args2...>(this->resource());
+ __use_alloc<_Tp2, memory_resource*, _Args2...>(__resource);
::new(__p) std::pair<_Tp1, _Tp2>(piecewise_construct,
_M_construct_p(__x_use_tag, __x),
@@ -377,11 +379,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__r = new_delete_resource();
return __get_default_resource().exchange(__r);
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif
diff --git a/libstdc++-v3/include/experimental/numeric b/libstdc++-v3/include/experimental/numeric
index b7b8207069f..33e7b55ef90 100644
--- a/libstdc++-v3/include/experimental/numeric
+++ b/libstdc++-v3/include/experimental/numeric
@@ -44,12 +44,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_gcd_lcm 201411
/// Greatest common divisor
@@ -75,10 +75,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static_assert(!is_same<_Nn, bool>::value, "lcm arguments are not bools");
return std::__detail::__lcm(__m, __n);
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/optional b/libstdc++-v3/include/experimental/optional
index 4a1e71d4234..d4c58a600bf 100644
--- a/libstdc++-v3/include/experimental/optional
+++ b/libstdc++-v3/include/experimental/optional
@@ -57,12 +57,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @defgroup optional Optional values
* @ingroup experimental
@@ -980,9 +980,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return optional<decay_t<_Tp>> { std::forward<_Tp>(__t) }; }
// @} group optional
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
-}
+} // namespace experimental
// [X.Y.12]
template<typename _Tp>
@@ -1001,7 +1000,9 @@ _GLIBCXX_END_NAMESPACE_VERSION
return __t ? hash<_Tp> {}(*__t) : __magic_disengaged_hash;
}
};
-}
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/propagate_const b/libstdc++-v3/include/experimental/propagate_const
index 719e17aa3d0..639f21a979e 100644
--- a/libstdc++-v3/include/experimental/propagate_const
+++ b/libstdc++-v3/include/experimental/propagate_const
@@ -43,12 +43,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @defgroup propagate_const Const-propagating wrapper
* @ingroup experimental
@@ -424,7 +424,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
// @} group propagate_const
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
@@ -533,6 +532,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef experimental::propagate_const<_Tp> second_argument_type;
typedef bool result_type;
};
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/random b/libstdc++-v3/include/experimental/random
index e28df5df721..2d22544e9ca 100644
--- a/libstdc++-v3/include/experimental/random
+++ b/libstdc++-v3/include/experimental/random
@@ -33,10 +33,10 @@
#include <experimental/bits/lfts_config.h>
namespace std {
-namespace experimental {
-inline namespace fundamentals_v2 {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace experimental {
+inline namespace fundamentals_v2 {
#define __cpp_lib_experimental_randint 201511
inline std::default_random_engine&
@@ -71,10 +71,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
_S_randint_engine().seed(__value);
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif
diff --git a/libstdc++-v3/include/experimental/ratio b/libstdc++-v3/include/experimental/ratio
index ffbae76ca79..bc2d0f267b2 100644
--- a/libstdc++-v3/include/experimental/ratio
+++ b/libstdc++-v3/include/experimental/ratio
@@ -44,12 +44,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// See C++14 §20.11.5, ratio comparison
template <typename _R1, typename _R2>
constexpr bool ratio_equal_v = ratio_equal<_R1, _R2>::value;
@@ -63,10 +63,10 @@ template <typename _R1, typename _R2>
constexpr bool ratio_greater_v = ratio_greater<_R1, _R2>::value;
template <typename _R1, typename _R2>
constexpr bool ratio_greater_equal_v = ratio_greater_equal<_R1, _R2>::value;
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/regex b/libstdc++-v3/include/experimental/regex
index 9b5679fc78e..bfcaf6b85c3 100644
--- a/libstdc++-v3/include/experimental/regex
+++ b/libstdc++-v3/include/experimental/regex
@@ -40,13 +40,14 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
namespace pmr
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_CXX11
template<typename _BidirectionalIterator>
@@ -60,11 +61,11 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
typedef match_results<wstring::const_iterator> wsmatch;
_GLIBCXX_END_NAMESPACE_CXX11
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/set b/libstdc++-v3/include/experimental/set
index a10617bb2a9..fba136c90c5 100644
--- a/libstdc++-v3/include/experimental/set
+++ b/libstdc++-v3/include/experimental/set
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Key, typename _Compare, typename _Alloc,
typename _Predicate>
inline void
@@ -59,23 +59,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
erase_if(multiset<_Key, _Compare, _Alloc>& __cont, _Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); }
-_GLIBCXX_END_NAMESPACE_VERSION
-
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template<typename _Key, typename _Compare = less<_Key>>
- using set = std::set<_Key, _Compare, polymorphic_allocator<_Key>>;
-
- template<typename _Key, typename _Compare = less<_Key>>
- using multiset = std::multiset<_Key, _Compare,
- polymorphic_allocator<_Key>>;
+ namespace pmr {
+ template<typename _Key, typename _Compare = less<_Key>>
+ using set = std::set<_Key, _Compare, polymorphic_allocator<_Key>>;
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
+ template<typename _Key, typename _Compare = less<_Key>>
+ using multiset = std::multiset<_Key, _Compare,
+ polymorphic_allocator<_Key>>;
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/source_location b/libstdc++-v3/include/experimental/source_location
index b06d8b651ae..a7fa95549b3 100644
--- a/libstdc++-v3/include/experimental/source_location
+++ b/libstdc++-v3/include/experimental/source_location
@@ -32,10 +32,10 @@
#include <cstdint>
namespace std {
-namespace experimental {
-inline namespace fundamentals_v2 {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace experimental {
+inline namespace fundamentals_v2 {
#define __cpp_lib_experimental_source_location 201505
struct source_location
@@ -77,10 +77,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
uint_least32_t _M_line;
uint_least32_t _M_col;
};
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif
diff --git a/libstdc++-v3/include/experimental/string b/libstdc++-v3/include/experimental/string
index 5347991959e..893013b1869 100644
--- a/libstdc++-v3/include/experimental/string
+++ b/libstdc++-v3/include/experimental/string
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _CharT, typename _Traits, typename _Alloc,
typename _Predicate>
inline void
@@ -64,30 +64,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__cont.end());
}
-_GLIBCXX_END_NAMESPACE_VERSION
+ namespace pmr {
+ _GLIBCXX_BEGIN_NAMESPACE_CXX11
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-_GLIBCXX_BEGIN_NAMESPACE_CXX11
+ // basic_string using polymorphic allocator in namespace pmr
+ template<typename _CharT, typename _Traits = char_traits<_CharT>>
+ using basic_string =
+ std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
- // basic_string using polymorphic allocator in namespace pmr
- template<typename _CharT, typename _Traits = char_traits<_CharT>>
- using basic_string =
- std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
-
- // basic_string typedef names using polymorphic allocator in namespace
- // std::experimental::pmr
- typedef basic_string<char> string;
- typedef basic_string<char16_t> u16string;
- typedef basic_string<char32_t> u32string;
- typedef basic_string<wchar_t> wstring;
-
-_GLIBCXX_END_NAMESPACE_CXX11
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
+ // basic_string typedef names using polymorphic allocator in namespace
+ // std::experimental::pmr
+ typedef basic_string<char> string;
+ typedef basic_string<char16_t> u16string;
+ typedef basic_string<char32_t> u32string;
+ typedef basic_string<wchar_t> wstring;
+ _GLIBCXX_END_NAMESPACE_CXX11
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view
index bd212ac3719..5cec5597744 100644
--- a/libstdc++-v3/include/experimental/string_view
+++ b/libstdc++-v3/include/experimental/string_view
@@ -45,12 +45,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_string_view 201411
/**
@@ -434,23 +434,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
const _CharT* _M_str;
};
-_GLIBCXX_END_NAMESPACE_VERSION
-
// [string.view.comparison], non-member basic_string_view comparison functions
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Identity transform to create a non-deduced context, so that only one
// argument participates in template argument deduction and the other
// argument gets implicitly converted to the deduced type. See n3766.html.
template<typename _Tp>
using __idt = common_type_t<_Tp>;
-_GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _CharT, typename _Traits>
inline bool
operator==(basic_string_view<_CharT, _Traits> __x,
@@ -577,15 +571,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using u16string_view = basic_string_view<char16_t>;
using u32string_view = basic_string_view<char32_t>;
#endif
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
// [string.view.hash], hash support:
-
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Tp>
struct hash;
@@ -647,7 +637,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_fast_hash<hash<experimental::u32string_view>> : std::false_type
{ };
#endif
-_GLIBCXX_END_NAMESPACE_VERSION
namespace experimental
{
@@ -656,8 +645,6 @@ namespace experimental
{
inline namespace string_view_literals
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
inline constexpr basic_string_view<char>
operator""sv(const char* __str, size_t __len)
{ return basic_string_view<char>{__str, __len}; }
@@ -677,11 +664,11 @@ namespace experimental
operator""sv(const char32_t* __str, size_t __len)
{ return basic_string_view<char32_t>{__str, __len}; }
#endif
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace string_literals
} // namespace literals
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#include <experimental/bits/string_view.tcc>
diff --git a/libstdc++-v3/include/experimental/system_error b/libstdc++-v3/include/experimental/system_error
index 2b4855dba72..2bad7503b2f 100644
--- a/libstdc++-v3/include/experimental/system_error
+++ b/libstdc++-v3/include/experimental/system_error
@@ -44,22 +44,22 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// See C++14 §19.5, System error support
template <typename _Tp>
constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value;
template <typename _Tp>
constexpr bool is_error_condition_enum_v =
is_error_condition_enum<_Tp>::value;
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/tuple b/libstdc++-v3/include/experimental/tuple
index 879636eecd8..a12fa0a3327 100644
--- a/libstdc++-v3/include/experimental/tuple
+++ b/libstdc++-v3/include/experimental/tuple
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// See C++14 §20.4.2.5, tuple helper classes
template <typename _Tp>
constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
@@ -71,10 +71,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
std::forward<_Tuple>(__t),
_Indices{});
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/type_traits b/libstdc++-v3/include/experimental/type_traits
index 7ec06308ba9..3885c168e31 100644
--- a/libstdc++-v3/include/experimental/type_traits
+++ b/libstdc++-v3/include/experimental/type_traits
@@ -44,12 +44,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_type_trait_variable_templates 201402
// See C++14 §20.10.4.1, primary type categories
@@ -218,13 +218,10 @@ template <typename _From, typename _To>
// raw_invocation_type (still unimplemented)
// invocation_type_t (still unimplemented)
// raw_invocation_type_t (still unimplemented)
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v1
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_detect 201505
// [meta.detect]
@@ -299,10 +296,10 @@ template<typename... _Bn>
template<typename _Pp>
constexpr bool negation_v
= negation<_Pp>::value;
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // __cplusplus <= 201103L
diff --git a/libstdc++-v3/include/experimental/unordered_map b/libstdc++-v3/include/experimental/unordered_map
index fbc44b267b5..cddd5b3d78c 100644
--- a/libstdc++-v3/include/experimental/unordered_map
+++ b/libstdc++-v3/include/experimental/unordered_map
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Key, typename _Tp, typename _Hash, typename _CPred,
typename _Alloc, typename _Predicate>
inline void
@@ -61,28 +61,24 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); }
-_GLIBCXX_END_NAMESPACE_VERSION
-
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
- typename _Pred = equal_to<_Key>>
- using unordered_map
+ namespace pmr {
+ template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
+ typename _Pred = equal_to<_Key>>
+ using unordered_map
= std::unordered_map<_Key, _Tp, _Hash, _Pred,
polymorphic_allocator<pair<const _Key, _Tp>>>;
- template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
- typename _Pred = equal_to<_Key>>
- using unordered_multimap
+ template<typename _Key, typename _Tp, typename _Hash = hash<_Key>,
+ typename _Pred = equal_to<_Key>>
+ using unordered_multimap
= std::unordered_multimap<_Key, _Tp, _Hash, _Pred,
polymorphic_allocator<pair<const _Key, _Tp>>>;
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/unordered_set b/libstdc++-v3/include/experimental/unordered_set
index 3c8fe255275..816327f9ba7 100644
--- a/libstdc++-v3/include/experimental/unordered_set
+++ b/libstdc++-v3/include/experimental/unordered_set
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Key, typename _Hash, typename _CPred, typename _Alloc,
typename _Predicate>
inline void
@@ -61,27 +61,23 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Predicate __pred)
{ __detail::__erase_nodes_if(__cont, __pred); }
-_GLIBCXX_END_NAMESPACE_VERSION
-
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template<typename _Key, typename _Hash = hash<_Key>,
- typename _Pred = equal_to<_Key>>
- using unordered_set
+ namespace pmr {
+ template<typename _Key, typename _Hash = hash<_Key>,
+ typename _Pred = equal_to<_Key>>
+ using unordered_set
= std::unordered_set<_Key, _Hash, _Pred, polymorphic_allocator<_Key>>;
- template<typename _Key, typename _Hash = hash<_Key>,
- typename _Pred = equal_to<_Key>>
- using unordered_multiset
+ template<typename _Key, typename _Hash = hash<_Key>,
+ typename _Pred = equal_to<_Key>>
+ using unordered_multiset
= std::unordered_multiset<_Key, _Hash, _Pred,
polymorphic_allocator<_Key>>;
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/experimental/utility b/libstdc++-v3/include/experimental/utility
index db85c5cc62c..5d21d67e387 100644
--- a/libstdc++-v3/include/experimental/utility
+++ b/libstdc++-v3/include/experimental/utility
@@ -34,16 +34,16 @@
#include <experimental/bits/lfts_config.h>
namespace std {
-namespace experimental {
-inline namespace fundamentals_v2 {
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace experimental {
+inline namespace fundamentals_v2 {
// 3.1.2, erased-type placeholder
using erased_type = std::__erased_type;
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif
diff --git a/libstdc++-v3/include/experimental/vector b/libstdc++-v3/include/experimental/vector
index b75a3bc7ce4..e77dd2e4771 100644
--- a/libstdc++-v3/include/experimental/vector
+++ b/libstdc++-v3/include/experimental/vector
@@ -41,12 +41,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace experimental
{
inline namespace fundamentals_v2
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_experimental_erase_if 201411
template<typename _Tp, typename _Alloc, typename _Predicate>
@@ -65,19 +65,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__cont.end());
}
-_GLIBCXX_END_NAMESPACE_VERSION
-
-namespace pmr {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- template<typename _Tp>
- using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace pmr
+ namespace pmr {
+ template<typename _Tp>
+ using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
+ } // namespace pmr
} // namespace fundamentals_v2
} // namespace experimental
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // C++14
diff --git a/libstdc++-v3/include/ext/bitmap_allocator.h b/libstdc++-v3/include/ext/bitmap_allocator.h
index 3e3126985b7..65541a499eb 100644
--- a/libstdc++-v3/include/ext/bitmap_allocator.h
+++ b/libstdc++-v3/include/ext/bitmap_allocator.h
@@ -44,12 +44,13 @@
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
using std::size_t;
using std::ptrdiff_t;
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
/** @class __mini_vector bitmap_allocator.h bitmap_allocator.h
*
* @brief __mini_vector<> is a stripped down version of the
@@ -501,12 +502,8 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
size_t __mask = 1 << __pos;
*__pbmap |= __mask;
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/** @brief Generic Version of the bsf instruction.
*/
inline size_t
@@ -1134,4 +1131,3 @@ _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __gnu_cxx
#endif
-
diff --git a/libstdc++-v3/include/ext/codecvt_specializations.h b/libstdc++-v3/include/ext/codecvt_specializations.h
index 1f0452f4f80..fdc5c5b98bf 100644
--- a/libstdc++-v3/include/ext/codecvt_specializations.h
+++ b/libstdc++-v3/include/ext/codecvt_specializations.h
@@ -41,8 +41,8 @@
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
-_GLIBCXX_BEGIN_NAMESPACE_CXX11
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+_GLIBCXX_BEGIN_NAMESPACE_CXX11
/// Extension to use iconv for dealing with character encodings.
// This includes conversions and comparisons between various character
@@ -215,8 +215,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef typename std::fpos<state_type> pos_type;
};
-_GLIBCXX_END_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_CXX11
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
diff --git a/libstdc++-v3/include/ext/random b/libstdc++-v3/include/ext/random
index d93757b08dd..3665b285de7 100644
--- a/libstdc++-v3/include/ext/random
+++ b/libstdc++-v3/include/ext/random
@@ -112,7 +112,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static constexpr result_type
min()
- { return 0; };
+ { return 0; }
static constexpr result_type
max()
@@ -184,6 +184,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#ifdef __SSE2__
__m128i _M_state[_M_nstate];
#endif
+#ifdef __ARM_NEON
+#ifdef __aarch64__
+ __Uint32x4_t _M_state[_M_nstate];
+#endif
+#endif
uint32_t _M_state32[_M_nstate32];
result_type _M_stateT[state_size];
} __attribute__ ((__aligned__ (16)));
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index 785205cb2b5..9f707a75960 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -65,6 +65,8 @@
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace __detail
{
enum { _S_max_rope_depth = 45 };
@@ -76,8 +78,6 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
using std::allocator;
using std::_Destroy;
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// See libstdc++/36832.
template<typename _ForwardIterator, typename _Allocator>
void
@@ -150,7 +150,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
class char_producer
{
public:
- virtual ~char_producer() { };
+ virtual ~char_producer() { }
virtual void
operator()(size_t __start_pos, size_t __len,
@@ -314,7 +314,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// compile-time would do. Hence this should all be private
// for now.
// The symmetry with char_producer is accidental and temporary.
- virtual ~_Rope_char_consumer() { };
+ virtual ~_Rope_char_consumer() { }
virtual bool
operator()(const _CharT* __buffer, size_t __len) = 0;
@@ -924,9 +924,9 @@ protected:
~_Rope_self_destruct_ptr()
{ _Rope_RopeRep<_CharT, _Alloc>::_S_unref(_M_ptr); }
#if __cpp_exceptions
- _Rope_self_destruct_ptr() : _M_ptr(0) { };
+ _Rope_self_destruct_ptr() : _M_ptr(0) { }
#else
- _Rope_self_destruct_ptr() { };
+ _Rope_self_destruct_ptr() { }
#endif
_Rope_self_destruct_ptr(_Rope_RopeRep<_CharT, _Alloc>* __p)
: _M_ptr(__p) { }
@@ -1153,7 +1153,7 @@ protected:
typedef const _CharT* pointer;
public:
- _Rope_const_iterator() { };
+ _Rope_const_iterator() { }
_Rope_const_iterator(const _Rope_const_iterator& __x)
: _Rope_iterator_base<_CharT,_Alloc>(__x) { }
@@ -1325,7 +1325,7 @@ protected:
_Rope_iterator()
{
this->_M_root = 0; // Needed for reference counting.
- };
+ }
_Rope_iterator(const _Rope_iterator& __x)
: _Rope_iterator_base<_CharT, _Alloc>(__x)
@@ -2937,10 +2937,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
template<>
struct hash<__gnu_cxx::crope>
{
@@ -2967,9 +2967,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return 13 * __str[0] + 5 * __str[__size - 1] + __size;
}
};
+} // namespace tr1
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace tr1
} // namespace std
# include <ext/ropeimpl.h>
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 471b13f4f95..9e88ce14c18 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -844,7 +844,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
public:
_Rope_flatten_char_consumer(_CharT* __buffer)
- { _M_buf_ptr = __buffer; };
+ { _M_buf_ptr = __buffer; }
~_Rope_flatten_char_consumer() {}
@@ -897,8 +897,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Insert_ostream& _M_o;
public:
_Rope_insert_char_consumer(_Insert_ostream& __writer)
- : _M_o(__writer) {};
- ~_Rope_insert_char_consumer() { };
+ : _M_o(__writer) {}
+ ~_Rope_insert_char_consumer() { }
// Caller is presumed to own the ostream
bool operator() (const _CharT* __leaf, size_t __n);
// Returns true to continue traversal.
diff --git a/libstdc++-v3/include/ext/typelist.h b/libstdc++-v3/include/ext/typelist.h
index 46e653b40c5..3999c153501 100644
--- a/libstdc++-v3/include/ext/typelist.h
+++ b/libstdc++-v3/include/ext/typelist.h
@@ -127,18 +127,7 @@ namespace typelist
template<typename T1, typename T2, typename T3,
typename T4, typename T5, typename T6>
struct create6;
-} // namespace typelist
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
-
-namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
-namespace typelist
-{
namespace detail
{
template<typename Fn, typename Typelist_Chain>
@@ -366,10 +355,6 @@ namespace detail
typedef typename append_type::type::root type;
};
} // namespace detail
-} // namespace typelist
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
#define _GLIBCXX_TYPELIST_CHAIN1(X0) __gnu_cxx::typelist::chain<X0, __gnu_cxx::typelist::null_type>
#define _GLIBCXX_TYPELIST_CHAIN2(X0, X1) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN1(X1) >
@@ -392,12 +377,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
#define _GLIBCXX_TYPELIST_CHAIN19(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN18(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18) >
#define _GLIBCXX_TYPELIST_CHAIN20(X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19) __gnu_cxx::typelist::chain<X0, _GLIBCXX_TYPELIST_CHAIN19(X1, X2, X3, X4, X5, X6, X7, X8, X9, X10, X11, X12, X13, X14, X15, X16, X17, X18, X19) >
-namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
-namespace typelist
-{
template<typename Fn, typename Typelist>
void
apply(Fn& fn, Typelist)
diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono
index c3a6ba8f873..1bcbf524a7b 100644
--- a/libstdc++-v3/include/std/chrono
+++ b/libstdc++-v3/include/std/chrono
@@ -45,6 +45,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
/**
* @defgroup chrono Time
* @ingroup utilities
@@ -58,19 +60,13 @@ namespace std _GLIBCXX_VISIBILITY(default)
*/
namespace chrono
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Rep, typename _Period = ratio<1>>
struct duration;
template<typename _Clock, typename _Dur = typename _Clock::duration>
struct time_point;
-
- _GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// 20.11.4.3 specialization of common_type (for duration, sfinae-friendly)
template<typename _CT, typename _Period1, typename _Period2>
@@ -117,12 +113,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
common_type<_Duration1, _Duration2>>::type, _Clock>::type
{ };
-_GLIBCXX_END_NAMESPACE_VERSION
-
namespace chrono
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// Primary template for duration_cast impl.
template<typename _ToDur, typename _CF, typename _CR,
bool _NumIsOne = false, bool _DenIsOne = false>
@@ -871,8 +863,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
using high_resolution_clock = system_clock;
} // end inline namespace _V2
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace chrono
#if __cplusplus > 201103L
@@ -883,8 +873,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
{
inline namespace chrono_literals
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Rep, unsigned long long _Val>
struct _Checked_integral_constant
: integral_constant<_Rep, static_cast<_Rep>(_Val)>
@@ -959,22 +947,19 @@ _GLIBCXX_END_NAMESPACE_VERSION
operator""ns()
{ return __check_overflow<chrono::nanoseconds, _Digits...>(); }
- _GLIBCXX_END_NAMESPACE_VERSION
} // inline namespace chrono_literals
} // inline namespace literals
namespace chrono
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- using namespace literals::chrono_literals;
-
- _GLIBCXX_END_NAMESPACE_VERSION
+ using namespace literals::chrono_literals;
} // namespace chrono
#endif // __cplusplus > 201103L
// @} group chrono
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif //_GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index 6342c98e88a..bd8b09d84f0 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -1937,14 +1937,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return std::complex<__type>(__x, -__type());
}
-_GLIBCXX_END_NAMESPACE_VERSION
-
#if __cplusplus > 201103L
inline namespace literals {
inline namespace complex_literals {
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
#define __cpp_lib_complex_udls 201309
constexpr std::complex<float>
@@ -1971,12 +1967,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator""il(unsigned long long __num)
{ return std::complex<long double>{0.0L, static_cast<long double>(__num)}; }
-_GLIBCXX_END_NAMESPACE_VERSION
} // inline namespace complex_literals
} // inline namespace literals
#endif // C++14
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // C++11
diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional
index 465b3ec7792..a6d121bb150 100644
--- a/libstdc++-v3/include/std/functional
+++ b/libstdc++-v3/include/std/functional
@@ -259,15 +259,12 @@ _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type)
*/
template<int _Num> struct _Placeholder { };
- _GLIBCXX_END_NAMESPACE_VERSION
-
/** @namespace std::placeholders
* @brief ISO C++11 entities sub-namespace for functional.
* @ingroup binders
*/
namespace placeholders
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
/* Define a large number of placeholders. There is no way to
* simplify this with variadic templates, because we're introducing
* unique names for each.
@@ -301,11 +298,8 @@ _GLIBCXX_MEM_FN_TRAITS(&& noexcept, false_type, true_type)
extern const _Placeholder<27> _27;
extern const _Placeholder<28> _28;
extern const _Placeholder<29> _29;
- _GLIBCXX_END_NAMESPACE_VERSION
}
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* Partial specialization of is_placeholder that provides the placeholder
* number for the placeholder objects defined by libstdc++.
diff --git a/libstdc++-v3/include/std/istream b/libstdc++-v3/include/std/istream
index 1fa25555771..233cc6b0145 100644
--- a/libstdc++-v3/include/std/istream
+++ b/libstdc++-v3/include/std/istream
@@ -150,9 +150,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* whatever data is appropriate for the type of the argument.
*
* If an exception is thrown during extraction, ios_base::badbit
- * will be turned on in the stream's error state without causing an
- * ios_base::failure to be thrown. The original exception will then
- * be rethrown.
+ * will be turned on in the stream's error state (without causing an
+ * ios_base::failure to be thrown) and the original exception will
+ * be rethrown if badbit is set in the exceptions mask.
*/
//@{
@@ -286,9 +286,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* by gcount().
*
* If an exception is thrown during extraction, ios_base::badbit
- * will be turned on in the stream's error state without causing an
- * ios_base::failure to be thrown. The original exception will then
- * be rethrown.
+ * will be turned on in the stream's error state (without causing an
+ * ios_base::failure to be thrown) and the original exception will
+ * be rethrown if badbit is set in the exceptions mask.
*/
/**
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex
index df48b460571..fadb9f60481 100644
--- a/libstdc++-v3/include/std/mutex
+++ b/libstdc++-v3/include/std/mutex
@@ -557,7 +557,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
#if __cplusplus > 201402L
-#define __cpp_lib_scoped_lock 201703
+#define __cpp_lib_scoped_lock 201707
/** @brief A scoped lock type for multiple lockable objects.
*
* A scoped_lock controls mutex ownership within a scope, releasing
@@ -570,7 +570,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit scoped_lock(_MutexTypes&... __m) : _M_devices(std::tie(__m...))
{ std::lock(__m...); }
- explicit scoped_lock(_MutexTypes&... __m, adopt_lock_t) noexcept
+ explicit scoped_lock(adopt_lock_t, _MutexTypes&... __m) noexcept
: _M_devices(std::tie(__m...))
{ } // calling thread owns mutex
@@ -609,7 +609,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
explicit scoped_lock(mutex_type& __m) : _M_device(__m)
{ _M_device.lock(); }
- explicit scoped_lock(mutex_type& __m, adopt_lock_t) noexcept
+ explicit scoped_lock(adopt_lock_t, mutex_type& __m) noexcept
: _M_device(__m)
{ } // calling thread owns mutex
diff --git a/libstdc++-v3/include/std/numeric b/libstdc++-v3/include/std/numeric
index c7abbc1b681..17d629db81d 100644
--- a/libstdc++-v3/include/std/numeric
+++ b/libstdc++-v3/include/std/numeric
@@ -79,10 +79,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace __detail
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace __detail
+{
// std::abs is not constexpr and doesn't support unsigned integers.
template<typename _Tp>
constexpr
@@ -117,11 +117,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
* __detail::__abs_integral(__n)
: 0;
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
-}
-
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
+} // namespace __detail
#if __cplusplus > 201402L
diff --git a/libstdc++-v3/include/std/sstream b/libstdc++-v3/include/std/sstream
index 2a56d734806..e84b60c6417 100644
--- a/libstdc++-v3/include/std/sstream
+++ b/libstdc++-v3/include/std/sstream
@@ -112,7 +112,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
explicit
basic_stringbuf(const __string_type& __str,
ios_base::openmode __mode = ios_base::in | ios_base::out)
- : __streambuf_type(), _M_mode(), _M_string(__str.data(), __str.size())
+ : __streambuf_type(), _M_mode(),
+ _M_string(__str.data(), __str.size(), __str.get_allocator())
{ _M_stringbuf_init(__mode); }
#if __cplusplus >= 201103L
@@ -165,14 +166,14 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
__string_type
str() const
{
- __string_type __ret;
+ __string_type __ret(_M_string.get_allocator());
if (this->pptr())
{
// The current egptr() may not be the actual string end.
if (this->pptr() > this->egptr())
- __ret = __string_type(this->pbase(), this->pptr());
+ __ret.assign(this->pbase(), this->pptr());
else
- __ret = __string_type(this->pbase(), this->egptr());
+ __ret.assign(this->pbase(), this->egptr());
}
else
__ret = _M_string;
@@ -302,18 +303,31 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
__xfer_bufptrs(const basic_stringbuf& __from, basic_stringbuf* __to)
: _M_to{__to}, _M_goff{-1, -1, -1}, _M_poff{-1, -1, -1}
{
- const _CharT* __str = __from._M_string.data();
+ const _CharT* const __str = __from._M_string.data();
+ const _CharT* __end = nullptr;
if (__from.eback())
{
- _M_goff[0] = __from.eback() - __str;
- _M_goff[1] = __from.gptr() - __str;
- _M_goff[2] = __from.egptr() - __str;
+ _M_goff[0] = __from.eback() - __str;
+ _M_goff[1] = __from.gptr() - __str;
+ _M_goff[2] = __from.egptr() - __str;
+ __end = __from.egptr();
}
if (__from.pbase())
{
_M_poff[0] = __from.pbase() - __str;
_M_poff[1] = __from.pptr() - __from.pbase();
_M_poff[2] = __from.epptr() - __str;
+ if (__from.pptr() > __end)
+ __end = __from.pptr();
+ }
+
+ // Set _M_string length to the greater of the get and put areas.
+ if (__end)
+ {
+ // The const_cast avoids changing this constructor's signature,
+ // because it is exported from the dynamic library.
+ auto& __mut_from = const_cast<basic_stringbuf&>(__from);
+ __mut_from._M_string._M_length(__end - __str);
}
}
diff --git a/libstdc++-v3/include/std/streambuf b/libstdc++-v3/include/std/streambuf
index 862c4fdbe6d..a05b46e8199 100644
--- a/libstdc++-v3/include/std/streambuf
+++ b/libstdc++-v3/include/std/streambuf
@@ -768,8 +768,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
overflow(int_type __c = traits_type::eof())
{ return traits_type::eof(); }
-#if _GLIBCXX_USE_DEPRECATED
- // Annex D.6
+#if _GLIBCXX_USE_DEPRECATED && __cplusplus <= 201402L
+ // Annex D.6 (removed in C++17)
public:
/**
* @brief Tosses a character.
@@ -779,6 +779,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
*
* See http://gcc.gnu.org/ml/libstdc++/2002-05/msg00168.html
*/
+#if __cplusplus >= 201103L
+ [[__deprecated__("stossc is deprecated, use sbumpc instead")]]
+#endif
void
stossc()
{
diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view
index 311d6d725b3..88a7686618c 100644
--- a/libstdc++-v3/include/std/string_view
+++ b/libstdc++-v3/include/std/string_view
@@ -427,23 +427,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
size_t _M_len;
const _CharT* _M_str;
};
-_GLIBCXX_END_NAMESPACE_VERSION
// [string.view.comparison], non-member basic_string_view comparison function
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Identity transform to create a non-deduced context, so that only one
// argument participates in template argument deduction and the other
// argument gets implicitly converted to the deduced type. See n3766.html.
template<typename _Tp>
using __idt = common_type_t<_Tp>;
-_GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _CharT, typename _Traits>
inline bool
operator==(basic_string_view<_CharT, _Traits> __x,
@@ -634,14 +629,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct __is_fast_hash<hash<u32string_view>> : std::false_type
{ };
#endif
-_GLIBCXX_END_NAMESPACE_VERSION
inline namespace literals
{
inline namespace string_view_literals
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
inline constexpr basic_string_view<char>
operator""sv(const char* __str, size_t __len)
{ return basic_string_view<char>{__str, __len}; }
@@ -661,11 +653,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator""sv(const char32_t* __str, size_t __len)
{ return basic_string_view<char32_t>{__str, __len}; }
#endif
-
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace string_literals
} // namespace literals
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#include <bits/string_view.tcc>
diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread
index 8e2cb68e295..17db5ce87ae 100644
--- a/libstdc++-v3/include/std/thread
+++ b/libstdc++-v3/include/std/thread
@@ -321,16 +321,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __out << __id._M_thread;
}
-_GLIBCXX_END_NAMESPACE_VERSION
-
/** @namespace std::this_thread
* @brief ISO C++ 2011 entities sub-namespace for thread.
* 30.3.2 Namespace this_thread.
*/
namespace this_thread
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/// get_id
inline thread::id
get_id() noexcept
@@ -398,12 +394,11 @@ _GLIBCXX_END_NAMESPACE_VERSION
__now = _Clock::now();
}
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
}
// @} group threads
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant
index e5fe9f927c1..d0c22e35d0f 100644
--- a/libstdc++-v3/include/std/variant
+++ b/libstdc++-v3/include/std/variant
@@ -50,12 +50,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace __detail
{
namespace __variant
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<size_t _Np, typename... _Types>
struct _Nth_type;
@@ -67,12 +67,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
struct _Nth_type<0, _First, _Rest...>
{ using type = _First; };
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __variant
} // namespace __detail
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename... _Types> class tuple;
template<typename... _Types> class variant;
template <typename> struct hash;
@@ -141,13 +138,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr variant_alternative_t<_Np, variant<_Types...>> const&&
get(const variant<_Types...>&&);
-_GLIBCXX_END_NAMESPACE_VERSION
-
namespace __detail
{
namespace __variant
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Returns the first apparence of _Tp in _Types.
// Returns sizeof...(_Types) if _Tp is not in _Types.
template<typename _Tp, typename... _Types>
@@ -295,6 +289,46 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__variant::__ref_cast<_Tp>(__t));
}
+ template<typename... _Types>
+ struct _Traits
+ {
+ static constexpr bool _S_default_ctor =
+ is_default_constructible_v<typename _Nth_type<0, _Types...>::type>;
+ static constexpr bool _S_copy_ctor =
+ (is_copy_constructible_v<_Types> && ...);
+ static constexpr bool _S_move_ctor =
+ (is_move_constructible_v<_Types> && ...);
+ static constexpr bool _S_copy_assign =
+ _S_copy_ctor && _S_move_ctor
+ && (is_copy_assignable_v<_Types> && ...);
+ static constexpr bool _S_move_assign =
+ _S_move_ctor
+ && (is_move_assignable_v<_Types> && ...);
+
+ static constexpr bool _S_trivial_dtor =
+ (is_trivially_destructible_v<_Types> && ...);
+ static constexpr bool _S_trivial_copy_ctor =
+ (is_trivially_copy_constructible_v<_Types> && ...);
+ static constexpr bool _S_trivial_move_ctor =
+ (is_trivially_move_constructible_v<_Types> && ...);
+ static constexpr bool _S_trivial_copy_assign =
+ _S_trivial_dtor && (is_trivially_copy_assignable_v<_Types> && ...);
+ static constexpr bool _S_trivial_move_assign =
+ _S_trivial_dtor && (is_trivially_move_assignable_v<_Types> && ...);
+
+ // The following nothrow traits are for non-trivial SMFs. Trivial SMFs
+ // are always nothrow.
+ static constexpr bool _S_nothrow_default_ctor =
+ is_nothrow_default_constructible_v<
+ typename _Nth_type<0, _Types...>::type>;
+ static constexpr bool _S_nothrow_copy_ctor = false;
+ static constexpr bool _S_nothrow_move_ctor =
+ (is_nothrow_move_constructible_v<_Types> && ...);
+ static constexpr bool _S_nothrow_copy_assign = false;
+ static constexpr bool _S_nothrow_move_assign =
+ _S_nothrow_move_ctor && (is_nothrow_move_assignable_v<_Types> && ...);
+ };
+
// Defines members and ctors.
template<typename... _Types>
union _Variadic_union { };
@@ -360,6 +394,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
~_Variant_storage()
{ _M_reset(); }
+ void*
+ _M_storage() const
+ {
+ return const_cast<void*>(static_cast<const void*>(
+ std::addressof(_M_u)));
+ }
+
+ constexpr bool
+ _M_valid() const noexcept
+ {
+ return this->_M_index != __index_type(variant_npos);
+ }
+
_Variadic_union<_Types...> _M_u;
using __index_type = __select_index<_Types...>;
__index_type _M_index;
@@ -379,59 +426,108 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
void _M_reset()
{ _M_index = variant_npos; }
+ void*
+ _M_storage() const
+ {
+ return const_cast<void*>(static_cast<const void*>(
+ std::addressof(_M_u)));
+ }
+
+ constexpr bool
+ _M_valid() const noexcept
+ {
+ return this->_M_index != __index_type(variant_npos);
+ }
+
_Variadic_union<_Types...> _M_u;
using __index_type = __select_index<_Types...>;
__index_type _M_index;
};
- // Helps SFINAE on special member functions. Otherwise it can live in variant
- // class.
template<typename... _Types>
- struct _Variant_base :
- _Variant_storage<(std::is_trivially_destructible_v<_Types> && ...),
- _Types...>
- {
- using _Storage =
- _Variant_storage<(std::is_trivially_destructible_v<_Types> && ...),
- _Types...>;
+ using _Variant_storage_alias =
+ _Variant_storage<_Traits<_Types...>::_S_trivial_dtor, _Types...>;
- constexpr
- _Variant_base()
- noexcept(is_nothrow_default_constructible_v<
- variant_alternative_t<0, variant<_Types...>>>)
- : _Variant_base(in_place_index<0>) { }
+ // The following are (Copy|Move) (ctor|assign) layers for forwarding
+ // triviality and handling non-trivial SMF behaviors.
- _Variant_base(const _Variant_base& __rhs)
+ template<bool, typename... _Types>
+ struct _Copy_ctor_base : _Variant_storage_alias<_Types...>
+ {
+ using _Base = _Variant_storage_alias<_Types...>;
+ using _Base::_Base;
+
+ _Copy_ctor_base(const _Copy_ctor_base& __rhs)
+ noexcept(_Traits<_Types...>::_S_nothrow_copy_ctor)
{
if (__rhs._M_valid())
{
static constexpr void (*_S_vtable[])(void*, void*) =
{ &__erased_ctor<_Types&, const _Types&>... };
- _S_vtable[__rhs._M_index](_M_storage(), __rhs._M_storage());
+ _S_vtable[__rhs._M_index](this->_M_storage(), __rhs._M_storage());
this->_M_index = __rhs._M_index;
}
}
- _Variant_base(_Variant_base&& __rhs)
- noexcept((is_nothrow_move_constructible_v<_Types> && ...))
+ _Copy_ctor_base(_Copy_ctor_base&&) = default;
+ _Copy_ctor_base& operator=(const _Copy_ctor_base&) = default;
+ _Copy_ctor_base& operator=(_Copy_ctor_base&&) = default;
+ };
+
+ template<typename... _Types>
+ struct _Copy_ctor_base<true, _Types...> : _Variant_storage_alias<_Types...>
+ {
+ using _Base = _Variant_storage_alias<_Types...>;
+ using _Base::_Base;
+ };
+
+ template<typename... _Types>
+ using _Copy_ctor_alias =
+ _Copy_ctor_base<_Traits<_Types...>::_S_trivial_copy_ctor, _Types...>;
+
+ template<bool, typename... _Types>
+ struct _Move_ctor_base : _Copy_ctor_alias<_Types...>
+ {
+ using _Base = _Copy_ctor_alias<_Types...>;
+ using _Base::_Base;
+
+ _Move_ctor_base(_Move_ctor_base&& __rhs)
+ noexcept(_Traits<_Types...>::_S_nothrow_move_ctor)
{
if (__rhs._M_valid())
{
static constexpr void (*_S_vtable[])(void*, void*) =
{ &__erased_ctor<_Types&, _Types&&>... };
- _S_vtable[__rhs._M_index](_M_storage(), __rhs._M_storage());
+ _S_vtable[__rhs._M_index](this->_M_storage(), __rhs._M_storage());
this->_M_index = __rhs._M_index;
}
}
- template<size_t _Np, typename... _Args>
- constexpr explicit
- _Variant_base(in_place_index_t<_Np> __i, _Args&&... __args)
- : _Storage(__i, std::forward<_Args>(__args)...)
- { }
+ _Move_ctor_base(const _Move_ctor_base&) = default;
+ _Move_ctor_base& operator=(const _Move_ctor_base&) = default;
+ _Move_ctor_base& operator=(_Move_ctor_base&&) = default;
+ };
+
+ template<typename... _Types>
+ struct _Move_ctor_base<true, _Types...> : _Copy_ctor_alias<_Types...>
+ {
+ using _Base = _Copy_ctor_alias<_Types...>;
+ using _Base::_Base;
+ };
+
+ template<typename... _Types>
+ using _Move_ctor_alias =
+ _Move_ctor_base<_Traits<_Types...>::_S_trivial_move_ctor, _Types...>;
+
+ template<bool, typename... _Types>
+ struct _Copy_assign_base : _Move_ctor_alias<_Types...>
+ {
+ using _Base = _Move_ctor_alias<_Types...>;
+ using _Base::_Base;
- _Variant_base&
- operator=(const _Variant_base& __rhs)
+ _Copy_assign_base&
+ operator=(const _Copy_assign_base& __rhs)
+ noexcept(_Traits<_Types...>::_S_nothrow_copy_assign)
{
if (this->_M_index == __rhs._M_index)
{
@@ -439,16 +535,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
static constexpr void (*_S_vtable[])(void*, void*) =
{ &__erased_assign<_Types&, const _Types&>... };
- _S_vtable[__rhs._M_index](_M_storage(), __rhs._M_storage());
+ _S_vtable[__rhs._M_index](this->_M_storage(), __rhs._M_storage());
}
}
else
{
- _Variant_base __tmp(__rhs);
- this->~_Variant_base();
+ _Copy_assign_base __tmp(__rhs);
+ this->~_Copy_assign_base();
__try
{
- ::new (this) _Variant_base(std::move(__tmp));
+ ::new (this) _Copy_assign_base(std::move(__tmp));
}
__catch (...)
{
@@ -460,12 +556,35 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return *this;
}
- void _M_destructive_move(_Variant_base&& __rhs)
+ _Copy_assign_base(const _Copy_assign_base&) = default;
+ _Copy_assign_base(_Copy_assign_base&&) = default;
+ _Copy_assign_base& operator=(_Copy_assign_base&&) = default;
+ };
+
+ template<typename... _Types>
+ struct _Copy_assign_base<true, _Types...> : _Move_ctor_alias<_Types...>
+ {
+ using _Base = _Move_ctor_alias<_Types...>;
+ using _Base::_Base;
+ };
+
+ template<typename... _Types>
+ using _Copy_assign_alias =
+ _Copy_assign_base<_Traits<_Types...>::_S_trivial_copy_assign,
+ _Types...>;
+
+ template<bool, typename... _Types>
+ struct _Move_assign_base : _Copy_assign_alias<_Types...>
+ {
+ using _Base = _Copy_assign_alias<_Types...>;
+ using _Base::_Base;
+
+ void _M_destructive_move(_Move_assign_base&& __rhs)
{
- this->~_Variant_base();
+ this->~_Move_assign_base();
__try
{
- ::new (this) _Variant_base(std::move(__rhs));
+ ::new (this) _Move_assign_base(std::move(__rhs));
}
__catch (...)
{
@@ -474,40 +593,74 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
}
- _Variant_base&
- operator=(_Variant_base&& __rhs)
- noexcept((is_nothrow_move_constructible_v<_Types> && ...)
- && (is_nothrow_move_assignable_v<_Types> && ...))
+ _Move_assign_base&
+ operator=(_Move_assign_base&& __rhs)
+ noexcept(_Traits<_Types...>::_S_nothrow_move_assign)
{
if (this->_M_index == __rhs._M_index)
{
if (__rhs._M_valid())
{
static constexpr void (*_S_vtable[])(void*, void*) =
- { &__erased_assign<_Types&, _Types&&>... };
- _S_vtable[__rhs._M_index](_M_storage(), __rhs._M_storage());
+ { &__erased_assign<_Types&, const _Types&>... };
+ _S_vtable[__rhs._M_index](this->_M_storage(), __rhs._M_storage());
}
}
else
{
- _M_destructive_move(std::move(__rhs));
+ _Move_assign_base __tmp(__rhs);
+ this->~_Move_assign_base();
+ __try
+ {
+ ::new (this) _Move_assign_base(std::move(__tmp));
+ }
+ __catch (...)
+ {
+ this->_M_index = variant_npos;
+ __throw_exception_again;
+ }
}
+ __glibcxx_assert(this->_M_index == __rhs._M_index);
return *this;
}
- void*
- _M_storage() const
- {
- return const_cast<void*>(static_cast<const void*>(
- std::addressof(_Storage::_M_u)));
- }
+ _Move_assign_base(const _Move_assign_base&) = default;
+ _Move_assign_base(_Move_assign_base&&) = default;
+ _Move_assign_base& operator=(const _Move_assign_base&) = default;
+ };
- constexpr bool
- _M_valid() const noexcept
- {
- return this->_M_index !=
- typename _Storage::__index_type(variant_npos);
- }
+ template<typename... _Types>
+ struct _Move_assign_base<true, _Types...> : _Copy_assign_alias<_Types...>
+ {
+ using _Base = _Copy_assign_alias<_Types...>;
+ using _Base::_Base;
+ };
+
+ template<typename... _Types>
+ using _Move_assign_alias =
+ _Move_assign_base<_Traits<_Types...>::_S_trivial_move_assign,
+ _Types...>;
+
+ template<typename... _Types>
+ struct _Variant_base : _Move_assign_alias<_Types...>
+ {
+ using _Base = _Move_assign_alias<_Types...>;
+
+ constexpr
+ _Variant_base()
+ noexcept(_Traits<_Types...>::_S_nothrow_default_ctor)
+ : _Variant_base(in_place_index<0>) { }
+
+ template<size_t _Np, typename... _Args>
+ constexpr explicit
+ _Variant_base(in_place_index_t<_Np> __i, _Args&&... __args)
+ : _Base(__i, std::forward<_Args>(__args)...)
+ { }
+
+ _Variant_base(const _Variant_base&) = default;
+ _Variant_base(_Variant_base&&) = default;
+ _Variant_base& operator=(const _Variant_base&) = default;
+ _Variant_base& operator=(_Variant_base&&) = default;
};
// For how many times does _Tp appear in _Tuple?
@@ -720,12 +873,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
std::index_sequence<__indices...>>
: _Base_dedup<__indices, __poison_hash<remove_const_t<_Types>>>... { };
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __variant
} // namespace __detail
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Tp, typename... _Types>
inline constexpr bool holds_alternative(const variant<_Types...>& __v)
noexcept
@@ -882,16 +1032,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
class variant
: private __detail::__variant::_Variant_base<_Types...>,
private _Enable_default_constructor<
- is_default_constructible_v<
- variant_alternative_t<0, variant<_Types...>>>, variant<_Types...>>,
+ __detail::__variant::_Traits<_Types...>::_S_default_ctor,
+ variant<_Types...>>,
private _Enable_copy_move<
- (is_copy_constructible_v<_Types> && ...),
- (is_copy_constructible_v<_Types> && ...)
- && (is_move_constructible_v<_Types> && ...)
- && (is_copy_assignable_v<_Types> && ...),
- (is_move_constructible_v<_Types> && ...),
- (is_move_constructible_v<_Types> && ...)
- && (is_move_assignable_v<_Types> && ...),
+ __detail::__variant::_Traits<_Types...>::_S_copy_ctor,
+ __detail::__variant::_Traits<_Types...>::_S_copy_assign,
+ __detail::__variant::_Traits<_Types...>::_S_move_ctor,
+ __detail::__variant::_Traits<_Types...>::_S_move_assign,
variant<_Types...>>
{
private:
@@ -905,8 +1052,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using _Base = __detail::__variant::_Variant_base<_Types...>;
using _Default_ctor_enabler =
_Enable_default_constructor<
- is_default_constructible_v<
- variant_alternative_t<0, variant<_Types...>>>, variant<_Types...>>;
+ __detail::__variant::_Traits<_Types...>::_S_default_ctor,
+ variant<_Types...>>;
template<typename _Tp>
static constexpr bool
@@ -933,21 +1080,26 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static constexpr size_t __index_of =
__detail::__variant::__index_of_v<_Tp, _Types...>;
+ using _Traits = __detail::__variant::_Traits<_Types...>;
+
public:
- constexpr variant()
- noexcept(is_nothrow_default_constructible_v<__to_type<0>>) = default;
- variant(const variant&) = default;
- variant(variant&&)
- noexcept((is_nothrow_move_constructible_v<_Types> && ...)) = default;
+ variant() = default;
+ variant(const variant& __rhs) = default;
+ variant(variant&&) = default;
+ variant& operator=(const variant&) = default;
+ variant& operator=(variant&&) = default;
+ ~variant() = default;
template<typename _Tp,
typename = enable_if_t<!is_same_v<decay_t<_Tp>, variant>>,
+ typename = enable_if_t<(sizeof...(_Types)>0)>,
typename = enable_if_t<__exactly_once<__accepted_type<_Tp&&>>
&& is_constructible_v<__accepted_type<_Tp&&>, _Tp&&>>>
constexpr
variant(_Tp&& __t)
noexcept(is_nothrow_constructible_v<__accepted_type<_Tp&&>, _Tp&&>)
- : variant(in_place_index<__accepted_index<_Tp&&>>, std::forward<_Tp>(__t))
+ : variant(in_place_index<__accepted_index<_Tp&&>>,
+ std::forward<_Tp>(__t))
{ __glibcxx_assert(holds_alternative<__accepted_type<_Tp&&>>(*this)); }
template<typename _Tp, typename... _Args,
@@ -955,7 +1107,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
&& is_constructible_v<_Tp, _Args&&...>>>
constexpr explicit
variant(in_place_type_t<_Tp>, _Args&&... __args)
- : variant(in_place_index<__index_of<_Tp>>, std::forward<_Args>(__args)...)
+ : variant(in_place_index<__index_of<_Tp>>,
+ std::forward<_Args>(__args)...)
{ __glibcxx_assert(holds_alternative<_Tp>(*this)); }
template<typename _Tp, typename _Up, typename... _Args,
@@ -988,13 +1141,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Default_ctor_enabler(_Enable_default_constructor_tag{})
{ __glibcxx_assert(index() == _Np); }
- ~variant() = default;
-
- variant& operator=(const variant&) = default;
- variant& operator=(variant&&)
- noexcept((is_nothrow_move_constructible_v<_Types> && ...)
- && (is_nothrow_move_assignable_v<_Types> && ...)) = default;
-
template<typename _Tp>
enable_if_t<__exactly_once<__accepted_type<_Tp&&>>
&& is_constructible_v<__accepted_type<_Tp&&>, _Tp&&>
@@ -1089,7 +1235,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
constexpr size_t index() const noexcept
{
if (this->_M_index ==
- typename _Base::_Storage::__index_type(variant_npos))
+ typename _Base::__index_type(variant_npos))
return variant_npos;
return this->_M_index;
}
@@ -1133,7 +1279,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static constexpr bool \
(*_S_erased_##__NAME[])(const variant&, const variant&) = \
{ &__detail::__variant::__erased_##__NAME< \
- const variant&, __indices>... }; \
+ const variant&, __indices>... }; \
template<size_t... __indices> \
constexpr inline bool \
_M_##__NAME(const variant& __rhs, \
@@ -1157,18 +1303,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#undef _VARIANT_RELATION_FUNCTION_TEMPLATE
template<size_t _Np, typename _Vp>
- friend constexpr decltype(auto) __detail::__variant::
-#if _GLIBCXX_INLINE_VERSION
- __8:: // Required due to PR c++/59256
-#endif
- __get(_Vp&& __v);
+ friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v);
template<typename _Vp>
- friend void* __detail::__variant::
-#if _GLIBCXX_INLINE_VERSION
- __8:: // Required due to PR c++/59256
-#endif
- __get_storage(_Vp&& __v);
+ friend void* __detail::__variant::__get_storage(_Vp&& __v);
#define _VARIANT_RELATION_FUNCTION_TEMPLATE(__OP) \
template<typename... _Tp> \
@@ -1279,7 +1417,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename... _Types>
struct hash<variant<_Types...>>
: private __detail::__variant::_Variant_hash_base<
- variant<_Types...>, std::index_sequence_for<_Types...>>,
+ variant<_Types...>, std::index_sequence_for<_Types...>>,
public __variant_hash_call_base<_Types...>
{
using result_type = size_t;
diff --git a/libstdc++-v3/include/tr1/array b/libstdc++-v3/include/tr1/array
index 606d019ade3..04c43411941 100644
--- a/libstdc++-v3/include/tr1/array
+++ b/libstdc++-v3/include/tr1/array
@@ -35,10 +35,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
/**
* @brief A standard container for storing a fixed size sequence of elements.
*
@@ -243,9 +243,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline const _Tp&
get(const array<_Tp, _Nm>& __arr)
{ return __arr[_Int]; }
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR1_ARRAY
diff --git a/libstdc++-v3/include/tr1/bessel_function.tcc b/libstdc++-v3/include/tr1/bessel_function.tcc
index 7ba4c8a7f0d..7ac733d73b8 100644
--- a/libstdc++-v3/include/tr1/bessel_function.tcc
+++ b/libstdc++-v3/include/tr1/bessel_function.tcc
@@ -50,6 +50,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
@@ -64,8 +66,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief Compute the gamma functions required by the Temme series
* expansions of @f$ N_\nu(x) @f$ and @f$ K_\nu(x) @f$.
@@ -626,13 +626,13 @@ namespace tr1
return __n_n;
}
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_BESSEL_FUNCTION_TCC
diff --git a/libstdc++-v3/include/tr1/beta_function.tcc b/libstdc++-v3/include/tr1/beta_function.tcc
index 2770eef3cd3..7463356906f 100644
--- a/libstdc++-v3/include/tr1/beta_function.tcc
+++ b/libstdc++-v3/include/tr1/beta_function.tcc
@@ -48,6 +48,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
@@ -62,8 +64,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief Return the beta function: \f$B(x,y)\f$.
*
@@ -195,13 +195,13 @@ namespace tr1
else
return __beta_lgamma(__x, __y);
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_BETA_FUNCTION_TCC
diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath
index b24e8c2a7d3..720452e4f5a 100644
--- a/libstdc++-v3/include/tr1/cmath
+++ b/libstdc++-v3/include/tr1/cmath
@@ -145,10 +145,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
#if _GLIBCXX_USE_C99_MATH_TR1
// Using declarations to bring names from libc's <math.h> into std::tr1.
@@ -1059,16 +1059,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
// @}
-#endif
-_GLIBCXX_END_NAMESPACE_VERSION
-}
-}
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-namespace tr1
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
+#endif /* _GLIBCXX_USE_C99_MATH_TR1 */
// DR 550. What should the return type of pow(float,int) be?
// NB: C++11 and TR1 != C++03.
@@ -1135,20 +1126,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif // C++11
-
-
-_GLIBCXX_END_NAMESPACE_VERSION
-}
-}
-
#if _GLIBCXX_USE_STD_SPEC_FUNCS
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-namespace tr1
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @defgroup tr1_math_spec_func Mathematical Special Functions
* @ingroup numerics
@@ -1250,12 +1229,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
using std::sph_neumann;
/* @} */ // tr1_math_spec_func
-_GLIBCXX_END_NAMESPACE_VERSION
-}
-}
#else // ! _GLIBCXX_USE_STD_SPEC_FUNCS
+} // namespace tr1
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
#include <bits/stl_algobase.h>
#include <limits>
#include <tr1/type_traits>
@@ -1274,10 +1255,10 @@ _GLIBCXX_END_NAMESPACE_VERSION
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
/**
* @defgroup tr1_math_spec_func Mathematical Special Functions
* @ingroup numerics
@@ -1680,9 +1661,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
}
/* @} */ // tr1_math_spec_func
-_GLIBCXX_END_NAMESPACE_VERSION
-}
-}
#endif // _GLIBCXX_USE_STD_SPEC_FUNCS
+} // namespace tr1
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace std
+
#endif // _GLIBCXX_TR1_CMATH
diff --git a/libstdc++-v3/include/tr1/complex b/libstdc++-v3/include/tr1/complex
index 10dce9d1bb4..2e7d05cf227 100644
--- a/libstdc++-v3/include/tr1/complex
+++ b/libstdc++-v3/include/tr1/complex
@@ -35,10 +35,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
/**
* @addtogroup complex_numbers
* @{
@@ -412,9 +412,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ return std::pow(__x, __y); }
// @} group complex_numbers
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR1_COMPLEX
diff --git a/libstdc++-v3/include/tr1/ell_integral.tcc b/libstdc++-v3/include/tr1/ell_integral.tcc
index 01f9313a256..4bd22e5eebc 100644
--- a/libstdc++-v3/include/tr1/ell_integral.tcc
+++ b/libstdc++-v3/include/tr1/ell_integral.tcc
@@ -44,6 +44,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
@@ -56,8 +58,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief Return the Carlson elliptic function @f$ R_F(x,y,z) @f$
* of the first kind.
@@ -745,12 +745,12 @@ namespace tr1
return __Pi + _Tp(2) * __n * __comp_ellint_3(__k, __nu);
}
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_ELL_INTEGRAL_TCC
diff --git a/libstdc++-v3/include/tr1/exp_integral.tcc b/libstdc++-v3/include/tr1/exp_integral.tcc
index 8e6f55178e7..663b2ce2f73 100644
--- a/libstdc++-v3/include/tr1/exp_integral.tcc
+++ b/libstdc++-v3/include/tr1/exp_integral.tcc
@@ -49,6 +49,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
@@ -61,8 +63,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _Tp> _Tp __expint_E1(_Tp);
/**
@@ -522,12 +522,12 @@ namespace tr1
else
return __expint_Ei(__x);
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_EXP_INTEGRAL_TCC
diff --git a/libstdc++-v3/include/tr1/functional b/libstdc++-v3/include/tr1/functional
index 256f94d8a5f..cb40e90e255 100644
--- a/libstdc++-v3/include/tr1/functional
+++ b/libstdc++-v3/include/tr1/functional
@@ -48,18 +48,15 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-#if __cplusplus >= 201103L
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+#if __cplusplus >= 201103L
template<int> struct _Placeholder;
template<typename> class _Bind;
template<typename, typename> class _Bind_result;
-_GLIBCXX_END_NAMESPACE_VERSION
#endif
namespace tr1
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _MemberPointer>
class _Mem_fn;
template<typename _Tp, typename _Class>
@@ -855,14 +852,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/// The type of placeholder objects defined by libstdc++.
template<int _Num> struct _Placeholder { };
-_GLIBCXX_END_NAMESPACE_VERSION
-
/** @namespace std::tr1::placeholders
* @brief Sub-namespace for tr1/functional.
*/
namespace placeholders
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
/* Define a large number of placeholders. There is no way to
* simplify this with variadic templates, because we're introducing
* unique names for each.
@@ -899,10 +893,8 @@ _GLIBCXX_END_NAMESPACE_VERSION
_Placeholder<28> _28;
_Placeholder<29> _29;
}
- _GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
/**
* Partial specialization of is_placeholder that provides the placeholder
* number for the placeholder objects defined by libstdc++.
@@ -2247,12 +2239,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline void
swap(function<_Signature>& __x, function<_Signature>& __y)
{ __x.swap(__y); }
-
-_GLIBCXX_END_NAMESPACE_VERSION
}
#if __cplusplus >= 201103L
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename> struct is_placeholder;
@@ -2301,8 +2290,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_Signature>>
: true_type { };
+#endif // C++11
_GLIBCXX_END_NAMESPACE_VERSION
-#endif
}
#endif // _GLIBCXX_TR1_FUNCTIONAL
diff --git a/libstdc++-v3/include/tr1/functional_hash.h b/libstdc++-v3/include/tr1/functional_hash.h
index acc766ddd53..f8cff25257f 100644
--- a/libstdc++-v3/include/tr1/functional_hash.h
+++ b/libstdc++-v3/include/tr1/functional_hash.h
@@ -34,10 +34,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
/// Class template hash.
// Declaration of default hash functor std::tr1::hash. The types for
// which std::tr1::hash<T> is well-defined is in clause 6.3.3. of the PDTR.
@@ -192,9 +192,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_PURE size_t
hash<const wstring&>::operator()(const wstring&) const;
#endif
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR1_FUNCTIONAL_HASH_H
diff --git a/libstdc++-v3/include/tr1/gamma.tcc b/libstdc++-v3/include/tr1/gamma.tcc
index dbbca1e9e80..7c4a664e5c9 100644
--- a/libstdc++-v3/include/tr1/gamma.tcc
+++ b/libstdc++-v3/include/tr1/gamma.tcc
@@ -50,6 +50,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
@@ -62,8 +64,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief This returns Bernoulli numbers from a table or by summation
* for larger values.
@@ -466,13 +466,13 @@ namespace tr1
return __result;
}
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // _GLIBCXX_TR1_GAMMA_TCC
diff --git a/libstdc++-v3/include/tr1/hashtable.h b/libstdc++-v3/include/tr1/hashtable.h
index 8dc7a41ad5e..6e798cfd1dd 100644
--- a/libstdc++-v3/include/tr1/hashtable.h
+++ b/libstdc++-v3/include/tr1/hashtable.h
@@ -37,10 +37,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
// Class template _Hashtable, class definition.
// Meaning of class template _Hashtable's template parameters
@@ -1173,9 +1173,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__throw_exception_again;
}
}
+} // namespace tr1
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace tr1
} // namespace std
#endif // _GLIBCXX_TR1_HASHTABLE_H
diff --git a/libstdc++-v3/include/tr1/hashtable_policy.h b/libstdc++-v3/include/tr1/hashtable_policy.h
index f44d0cf9a73..9a75443ccb6 100644
--- a/libstdc++-v3/include/tr1/hashtable_policy.h
+++ b/libstdc++-v3/include/tr1/hashtable_policy.h
@@ -30,12 +30,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace tr1
{
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// Helper function: return distance(first, last) for forward
// iterators, or 0 for input iterators.
template<class _Iterator>
@@ -772,7 +772,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_H1 _M_h1;
_H2 _M_h2;
};
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
}
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
diff --git a/libstdc++-v3/include/tr1/hypergeometric.tcc b/libstdc++-v3/include/tr1/hypergeometric.tcc
index 49af5f98d96..dc9f176e27a 100644
--- a/libstdc++-v3/include/tr1/hypergeometric.tcc
+++ b/libstdc++-v3/include/tr1/hypergeometric.tcc
@@ -43,6 +43,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
@@ -57,8 +59,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief This routine returns the confluent hypergeometric function
* by series expansion.
@@ -773,13 +773,13 @@ namespace tr1
else
return __hyperg_luke(__a, __b, __c, __x);
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
diff --git a/libstdc++-v3/include/tr1/legendre_function.tcc b/libstdc++-v3/include/tr1/legendre_function.tcc
index ea2a511d977..16fee54e9c4 100644
--- a/libstdc++-v3/include/tr1/legendre_function.tcc
+++ b/libstdc++-v3/include/tr1/legendre_function.tcc
@@ -48,6 +48,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
@@ -62,8 +64,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief Return the Legendre polynomial by recursion on order
* @f$ l @f$.
@@ -301,13 +301,13 @@ namespace tr1
}
}
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
diff --git a/libstdc++-v3/include/tr1/modified_bessel_func.tcc b/libstdc++-v3/include/tr1/modified_bessel_func.tcc
index d21e3c7de66..79d7d7578fa 100644
--- a/libstdc++-v3/include/tr1/modified_bessel_func.tcc
+++ b/libstdc++-v3/include/tr1/modified_bessel_func.tcc
@@ -50,6 +50,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
@@ -62,8 +64,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief Compute the modified Bessel functions @f$ I_\nu(x) @f$ and
* @f$ K_\nu(x) @f$ and their first derivatives
@@ -430,12 +430,12 @@ namespace tr1
return;
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
diff --git a/libstdc++-v3/include/tr1/poly_hermite.tcc b/libstdc++-v3/include/tr1/poly_hermite.tcc
index 80ea2187e4f..8136284310c 100644
--- a/libstdc++-v3/include/tr1/poly_hermite.tcc
+++ b/libstdc++-v3/include/tr1/poly_hermite.tcc
@@ -41,6 +41,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
@@ -53,8 +55,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief This routine returns the Hermite polynomial
* of order n: \f$ H_n(x) \f$ by recursion on n.
@@ -120,12 +120,12 @@ namespace tr1
else
return __poly_hermite_recursion(__n, __x);
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_POLY_HERMITE_TCC
diff --git a/libstdc++-v3/include/tr1/poly_laguerre.tcc b/libstdc++-v3/include/tr1/poly_laguerre.tcc
index 0c33c032040..420b1f34db4 100644
--- a/libstdc++-v3/include/tr1/poly_laguerre.tcc
+++ b/libstdc++-v3/include/tr1/poly_laguerre.tcc
@@ -43,6 +43,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
@@ -57,8 +59,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief This routine returns the associated Laguerre polynomial
* of order @f$ n @f$, degree @f$ \alpha @f$ for large n.
@@ -317,13 +317,13 @@ namespace tr1
inline _Tp
__laguerre(unsigned int __n, _Tp __x)
{ return __poly_laguerre<unsigned int, _Tp>(__n, 0, __x); }
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_POLY_LAGUERRE_TCC
diff --git a/libstdc++-v3/include/tr1/random.h b/libstdc++-v3/include/tr1/random.h
index 67654a8bb8f..79a5b8f8cd4 100644
--- a/libstdc++-v3/include/tr1/random.h
+++ b/libstdc++-v3/include/tr1/random.h
@@ -35,6 +35,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace tr1
{
// [5.1] Random number generation
@@ -50,8 +52,6 @@ namespace tr1
*/
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<typename _UIntType, int __w,
bool = __w < std::numeric_limits<_UIntType>::digits>
struct _Shift
@@ -212,12 +212,8 @@ namespace tr1
private:
_Engine* _M_g;
};
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* Produces random numbers on a given distribution function using a
* non-uniform random number generation engine.
@@ -594,7 +590,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
result_type
min() const
- { return 0; };
+ { return 0; }
result_type
max() const
@@ -2410,8 +2406,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/* @} */ // group tr1_random_distributions_continuous
/* @} */ // group tr1_random_distributions
/* @} */ // group tr1_random
-_GLIBCXX_END_NAMESPACE_VERSION
}
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_RANDOM_H
diff --git a/libstdc++-v3/include/tr1/random.tcc b/libstdc++-v3/include/tr1/random.tcc
index 265bd0bc2db..25f444a1644 100644
--- a/libstdc++-v3/include/tr1/random.tcc
+++ b/libstdc++-v3/include/tr1/random.tcc
@@ -33,6 +33,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace tr1
{
/*
@@ -40,8 +42,6 @@ namespace tr1
*/
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// General case for x = (ax + c) mod m -- use Schrage's algorithm to avoid
// integer overflow.
//
@@ -92,11 +92,8 @@ namespace tr1
__calc(_Tp __x)
{ return __a * __x + __c; }
};
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
const _UIntType
linear_congruential<_UIntType, __a, __c, __m>::multiplier;
@@ -1713,9 +1710,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__os.precision(__precision);
return __os;
}
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif
diff --git a/libstdc++-v3/include/tr1/regex b/libstdc++-v3/include/tr1/regex
index bfb5ef770d4..6cb8c154e86 100644
--- a/libstdc++-v3/include/tr1/regex
+++ b/libstdc++-v3/include/tr1/regex
@@ -45,6 +45,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace tr1
{
/**
@@ -58,8 +60,6 @@ namespace tr1
*/
namespace regex_constants
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @name 5.1 Regular Expression Syntax Options
*/
@@ -397,11 +397,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static const error_type error_stack(_S_error_stack);
//@}
-_GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// [7.8] Class regex_error
/**
* @brief A regular expression exception class.
@@ -2722,9 +2719,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#endif
//@}
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR1_REGEX
diff --git a/libstdc++-v3/include/tr1/riemann_zeta.tcc b/libstdc++-v3/include/tr1/riemann_zeta.tcc
index b4992f265ae..130cef63c45 100644
--- a/libstdc++-v3/include/tr1/riemann_zeta.tcc
+++ b/libstdc++-v3/include/tr1/riemann_zeta.tcc
@@ -46,6 +46,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
@@ -60,8 +62,6 @@ namespace tr1
// Implementation-space details.
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/**
* @brief Compute the Riemann zeta function @f$ \zeta(s) @f$
* by summation for s > 1.
@@ -431,13 +431,13 @@ namespace tr1
inline _Tp
__hurwitz_zeta(_Tp __a, _Tp __s)
{ return __hurwitz_zeta_glob(__a, __s); }
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_RIEMANN_ZETA_TCC
diff --git a/libstdc++-v3/include/tr1/shared_ptr.h b/libstdc++-v3/include/tr1/shared_ptr.h
index f702cd68972..95ac9775b9b 100644
--- a/libstdc++-v3/include/tr1/shared_ptr.h
+++ b/libstdc++-v3/include/tr1/shared_ptr.h
@@ -51,10 +51,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
/**
* @brief Exception possibly thrown by @c shared_ptr.
* @ingroup exceptions
@@ -1162,9 +1162,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
mutable weak_ptr<_Tp> _M_weak_this;
};
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _TR1_SHARED_PTR_H
diff --git a/libstdc++-v3/include/tr1/special_function_util.h b/libstdc++-v3/include/tr1/special_function_util.h
index 9d40a16ca6c..c4e9c476150 100644
--- a/libstdc++-v3/include/tr1/special_function_util.h
+++ b/libstdc++-v3/include/tr1/special_function_util.h
@@ -38,6 +38,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#if _GLIBCXX_USE_STD_SPEC_FUNCS
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
@@ -47,8 +49,6 @@ namespace tr1
#endif
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
/// A class to encapsulate type dependent floating point
/// constants. Not everything will be able to be expressed as
/// type logic.
@@ -130,12 +130,12 @@ namespace tr1
{ return __builtin_isnanl(__x); }
#endif
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
#if ! _GLIBCXX_USE_STD_SPEC_FUNCS && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
diff --git a/libstdc++-v3/include/tr1/tuple b/libstdc++-v3/include/tr1/tuple
index fe53a8b99b0..997542d241b 100644
--- a/libstdc++-v3/include/tr1/tuple
+++ b/libstdc++-v3/include/tr1/tuple
@@ -38,10 +38,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
// Adds a const reference to a non-reference type.
template<typename _Tp>
struct __add_c_ref
@@ -418,9 +418,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{
_Swallow_assign ignore;
}; // anonymous namespace
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR1_TUPLE
diff --git a/libstdc++-v3/include/tr1/type_traits b/libstdc++-v3/include/tr1/type_traits
index abdb83b48ec..83dd7b7dcf2 100644
--- a/libstdc++-v3/include/tr1/type_traits
+++ b/libstdc++-v3/include/tr1/type_traits
@@ -35,10 +35,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
/**
* @addtogroup metaprogramming
* @{
@@ -679,9 +679,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
#undef _DEFINE_SPEC
/// @} group metaprogramming
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR1_TYPE_TRAITS
diff --git a/libstdc++-v3/include/tr1/unordered_map.h b/libstdc++-v3/include/tr1/unordered_map.h
index 34776aeea58..a27654a45d2 100644
--- a/libstdc++-v3/include/tr1/unordered_map.h
+++ b/libstdc++-v3/include/tr1/unordered_map.h
@@ -29,10 +29,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
// NB: When we get typedef templates these class definitions
// will be unnecessary.
template<class _Key, class _Tp,
@@ -272,7 +272,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
swap(unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
diff --git a/libstdc++-v3/include/tr1/unordered_set.h b/libstdc++-v3/include/tr1/unordered_set.h
index f9d04901cc5..df24ca6b299 100644
--- a/libstdc++-v3/include/tr1/unordered_set.h
+++ b/libstdc++-v3/include/tr1/unordered_set.h
@@ -29,10 +29,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
// NB: When we get typedef templates these class definitions
// will be unnecessary.
template<class _Value,
@@ -261,7 +261,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
swap(unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x,
unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y)
{ __x.swap(__y); }
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
diff --git a/libstdc++-v3/include/tr1/utility b/libstdc++-v3/include/tr1/utility
index 91076d9882c..f114160005f 100644
--- a/libstdc++-v3/include/tr1/utility
+++ b/libstdc++-v3/include/tr1/utility
@@ -37,10 +37,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr1
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr1
+{
template<class _Tp>
class tuple_size;
@@ -100,9 +100,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline const typename tuple_element<_Int, std::pair<_Tp1, _Tp2> >::type&
get(const std::pair<_Tp1, _Tp2>& __in)
{ return __pair_get<_Int>::__const_get(__in); }
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR1_UTILITY
diff --git a/libstdc++-v3/include/tr2/bool_set b/libstdc++-v3/include/tr2/bool_set
index 9d55b3c0ebd..f89a8658932 100644
--- a/libstdc++-v3/include/tr2/bool_set
+++ b/libstdc++-v3/include/tr2/bool_set
@@ -36,10 +36,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr2
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr2
+{
/**
* bool_set
*
@@ -310,10 +310,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline bool_set
operator!=(bool_set __s, bool_set __t)
{ return ! (__s == __t); }
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#include <tr2/bool_set.tcc>
diff --git a/libstdc++-v3/include/tr2/bool_set.tcc b/libstdc++-v3/include/tr2/bool_set.tcc
index a5fd898a822..1ffcccac901 100644
--- a/libstdc++-v3/include/tr2/bool_set.tcc
+++ b/libstdc++-v3/include/tr2/bool_set.tcc
@@ -33,10 +33,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr2
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr2
+{
bool_set::_Bool_set_val
bool_set::_S_not[4] =
{ _S_true_, _S_false, _S_indet, _S_empty };
@@ -68,10 +68,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ _S_false, _S_true_, _S_indet, _S_empty },
{ _S_indet, _S_indet, _S_indet, _S_empty },
{ _S_empty, _S_empty, _S_empty, _S_empty } };
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
// I object to these things.
// The stuff in locale facets are for basic types.
diff --git a/libstdc++-v3/include/tr2/dynamic_bitset b/libstdc++-v3/include/tr2/dynamic_bitset
index ff4e5887eb9..4d16f8178b6 100644
--- a/libstdc++-v3/include/tr2/dynamic_bitset
+++ b/libstdc++-v3/include/tr2/dynamic_bitset
@@ -42,10 +42,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr2
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr2
+{
/**
* @defgroup dynamic_bitset Dynamic Bitset.
* @ingroup extensions
@@ -1220,9 +1220,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
/**
* @}
*/
+} // tr2
_GLIBCXX_END_NAMESPACE_VERSION
-} // tr2
} // std
#include <tr2/dynamic_bitset.tcc>
diff --git a/libstdc++-v3/include/tr2/dynamic_bitset.tcc b/libstdc++-v3/include/tr2/dynamic_bitset.tcc
index 7b64580ccfc..c2875e54257 100644
--- a/libstdc++-v3/include/tr2/dynamic_bitset.tcc
+++ b/libstdc++-v3/include/tr2/dynamic_bitset.tcc
@@ -34,10 +34,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr2
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr2
+{
// Definitions of non-inline functions from __dynamic_bitset_base.
template<typename _WordT, typename _Alloc>
void
@@ -272,9 +272,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__is.setstate(__state);
return __is;
}
+} // tr2
_GLIBCXX_END_NAMESPACE_VERSION
-} // tr2
} // std
#endif /* _GLIBCXX_TR2_DYNAMIC_BITSET_TCC */
diff --git a/libstdc++-v3/include/tr2/ratio b/libstdc++-v3/include/tr2/ratio
index c0a2d4d3065..a9b71c8f121 100644
--- a/libstdc++-v3/include/tr2/ratio
+++ b/libstdc++-v3/include/tr2/ratio
@@ -30,10 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr2
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr2
+{
template<intmax_t _Pn, size_t _Bit,
bool = _Bit < static_cast<size_t>
(std::numeric_limits<intmax_t>::digits)>
@@ -53,7 +53,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
typedef ratio<__safe_lshift<1, 60>::__value, 1> exbi;
//typedef ratio<__safe_lshift<1, 70>::__value, 1> zebi;
//typedef ratio<__safe_lshift<1, 80>::__value, 1> yobi;
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
diff --git a/libstdc++-v3/include/tr2/type_traits b/libstdc++-v3/include/tr2/type_traits
index 35f621500d6..b442ba5dc64 100644
--- a/libstdc++-v3/include/tr2/type_traits
+++ b/libstdc++-v3/include/tr2/type_traits
@@ -35,10 +35,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
-namespace tr2
-{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
+namespace tr2
+{
/**
* @addtogroup metaprogramming
* @{
@@ -98,9 +98,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
/// @} group metaprogramming
+}
_GLIBCXX_END_NAMESPACE_VERSION
}
-}
#endif // _GLIBCXX_TR2_TYPE_TRAITS
diff --git a/libstdc++-v3/libsupc++/new b/libstdc++-v3/libsupc++/new
index 04f172cebd0..795b33c4e6a 100644
--- a/libstdc++-v3/libsupc++/new
+++ b/libstdc++-v3/libsupc++/new
@@ -68,7 +68,7 @@ namespace std
class bad_array_new_length : public bad_alloc
{
public:
- bad_array_new_length() throw() { };
+ bad_array_new_length() throw() { }
// This declaration is not useless:
// http://gcc.gnu.org/onlinedocs/gcc-3.0.2/gcc_6.html#SEC118
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 8122cf81834..04f413adf04 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1555,15 +1555,15 @@ def build_libstdcxx_dictionary ():
libstdcxx_printer.add_container('std::', 'forward_list',
StdForwardListPrinter)
- libstdcxx_printer.add_version('std::tr1::', 'shared_ptr', SharedPointerPrinter)
- libstdcxx_printer.add_version('std::tr1::', 'weak_ptr', SharedPointerPrinter)
- libstdcxx_printer.add_version('std::tr1::', 'unordered_map',
+ libstdcxx_printer.add_version('std::', 'tr1::shared_ptr', SharedPointerPrinter)
+ libstdcxx_printer.add_version('std::', 'tr1::weak_ptr', SharedPointerPrinter)
+ libstdcxx_printer.add_version('std::', 'tr1::unordered_map',
Tr1UnorderedMapPrinter)
- libstdcxx_printer.add_version('std::tr1::', 'unordered_set',
+ libstdcxx_printer.add_version('std::', 'tr1::unordered_set',
Tr1UnorderedSetPrinter)
- libstdcxx_printer.add_version('std::tr1::', 'unordered_multimap',
+ libstdcxx_printer.add_version('std::', 'tr1::unordered_multimap',
Tr1UnorderedMapPrinter)
- libstdcxx_printer.add_version('std::tr1::', 'unordered_multiset',
+ libstdcxx_printer.add_version('std::', 'tr1::unordered_multiset',
Tr1UnorderedSetPrinter)
# These are the C++11 printer registrations for -D_GLIBCXX_DEBUG cases.
diff --git a/libstdc++-v3/src/c++11/chrono.cc b/libstdc++-v3/src/c++11/chrono.cc
index 39a52aea619..337860c23d8 100644
--- a/libstdc++-v3/src/c++11/chrono.cc
+++ b/libstdc++-v3/src/c++11/chrono.cc
@@ -41,10 +41,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace chrono
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// XXX GLIBCXX_ABI Deprecated
inline namespace _V2 {
@@ -97,9 +97,9 @@ namespace std _GLIBCXX_VISIBILITY(default)
}
} // end inline namespace _V2
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace chrono
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // _GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/src/c++11/compatibility-c++0x.cc b/libstdc++-v3/src/c++11/compatibility-c++0x.cc
index 358263baff4..811ccb5f120 100644
--- a/libstdc++-v3/src/c++11/compatibility-c++0x.cc
+++ b/libstdc++-v3/src/c++11/compatibility-c++0x.cc
@@ -44,6 +44,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
// gcc-4.4.0
// <mutex> exported std::lock_error
#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1)
@@ -130,7 +132,6 @@ namespace std _GLIBCXX_VISIBILITY(default)
constexpr bool system_clock::is_monotonic;
} // namespace chrono
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// gcc-5 replaces this with _V2::error_category
class error_category
{
@@ -169,7 +170,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator!=(const error_category& __other) const noexcept
{ return this != &__other; }
};
-_GLIBCXX_END_NAMESPACE_VERSION
// gcc-4.9.0
// LWG 2145 changes this constructor to constexpr i.e. inline
@@ -215,7 +215,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
const system_error_category system_category_instance{};
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
const error_category&
system_category() noexcept { return system_category_instance; }
@@ -227,7 +226,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_CONST const error_categoryxx& system_category() noexcept;
_GLIBCXX_CONST const error_categoryxx& generic_category() noexcept;
}
-_GLIBCXX_END_NAMESPACE_VERSION
error_condition
error_category::default_error_condition(int __i) const noexcept
@@ -254,5 +252,6 @@ _GLIBCXX_END_NAMESPACE_VERSION
return false;
}
+_GLIBCXX_END_NAMESPACE_VERSION
}
#endif
diff --git a/libstdc++-v3/src/c++11/compatibility-chrono.cc b/libstdc++-v3/src/c++11/compatibility-chrono.cc
index e401375928d..941eaf83556 100644
--- a/libstdc++-v3/src/c++11/compatibility-chrono.cc
+++ b/libstdc++-v3/src/c++11/compatibility-chrono.cc
@@ -38,10 +38,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace chrono
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// NB: Default configuration was no realtime.
struct system_clock
{
@@ -84,9 +84,9 @@ namespace std _GLIBCXX_VISIBILITY(default)
(__from(chrono::seconds(__sec)));
#endif
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace chrono
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // _GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/src/c++11/cxx11-shim_facets.cc b/libstdc++-v3/src/c++11/cxx11-shim_facets.cc
index b69959f4f13..fbff59eb5f0 100644
--- a/libstdc++-v3/src/c++11/cxx11-shim_facets.cc
+++ b/libstdc++-v3/src/c++11/cxx11-shim_facets.cc
@@ -45,6 +45,8 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
// Base class of facet shims, holds a reference to the underlying facet
// that the shim forwards to.
class locale::facet::__shim
@@ -67,8 +69,6 @@ namespace std _GLIBCXX_VISIBILITY(default)
namespace __facet_shims
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
namespace // unnamed
{
template<typename C>
@@ -777,10 +777,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
bool, ios_base&, wchar_t, long double, const __any_string*);
#endif
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __facet_shims
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// Create a new shim facet of type WHICH that forwards calls to F.
// F is the replacement facet provided by the user, WHICH is the ID of
// F's "other ABI twin" which we are replacing with a shim.
diff --git a/libstdc++-v3/src/c++11/hashtable_c++0x.cc b/libstdc++-v3/src/c++11/hashtable_c++0x.cc
index 1b099928942..3ddc10c72f7 100644
--- a/libstdc++-v3/src/c++11/hashtable_c++0x.cc
+++ b/libstdc++-v3/src/c++11/hashtable_c++0x.cc
@@ -34,12 +34,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
#include "../shared/hashtable-aux.cc"
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
// Return a prime no smaller than n.
std::size_t
_Prime_rehash_policy::_M_next_bkt(std::size_t __n) const
@@ -111,7 +111,7 @@ namespace __detail
else
return std::make_pair(false, 0);
}
+} // namespace __detail
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace __detail
} // namespace std
diff --git a/libstdc++-v3/src/c++11/placeholders.cc b/libstdc++-v3/src/c++11/placeholders.cc
index fad78f2e98d..48a05fab365 100644
--- a/libstdc++-v3/src/c++11/placeholders.cc
+++ b/libstdc++-v3/src/c++11/placeholders.cc
@@ -30,9 +30,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace placeholders
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
extern const _Placeholder<1> _1{};
extern const _Placeholder<2> _2{};
extern const _Placeholder<3> _3{};
@@ -62,6 +63,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
extern const _Placeholder<27> _27{};
extern const _Placeholder<28> _28{};
extern const _Placeholder<29> _29{};
- _GLIBCXX_END_NAMESPACE_VERSION
}
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
diff --git a/libstdc++-v3/src/c++11/thread.cc b/libstdc++-v3/src/c++11/thread.cc
index 4a94bdd2f8c..cd6d9fe6635 100644
--- a/libstdc++-v3/src/c++11/thread.cc
+++ b/libstdc++-v3/src/c++11/thread.cc
@@ -180,12 +180,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
return __n;
}
-_GLIBCXX_END_NAMESPACE_VERSION
-
namespace this_thread
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
void
__sleep_for(chrono::seconds __s, chrono::nanoseconds __ns)
{
@@ -217,10 +213,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
::Sleep(chrono::milliseconds(__s).count() + ms);
#endif
}
-
-_GLIBCXX_END_NAMESPACE_VERSION
}
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
diff --git a/libstdc++-v3/src/c++98/bitmap_allocator.cc b/libstdc++-v3/src/c++98/bitmap_allocator.cc
index 5a9696d97e0..b16c29143f1 100644
--- a/libstdc++-v3/src/c++98/bitmap_allocator.cc
+++ b/libstdc++-v3/src/c++98/bitmap_allocator.cc
@@ -26,9 +26,10 @@
namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
template class __mini_vector<
std::pair<bitmap_allocator<char>::_Alloc_block*,
bitmap_allocator<char>::_Alloc_block*> >;
@@ -41,11 +42,8 @@ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
template size_t** __lower_bound(size_t**, size_t**, size_t const&,
free_list::_LT_pointer_compare);
- _GLIBCXX_END_NAMESPACE_VERSION
}
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
size_t*
free_list::
_M_get(size_t __sz) throw(std::bad_alloc)
diff --git a/libstdc++-v3/src/c++98/hashtable_tr1.cc b/libstdc++-v3/src/c++98/hashtable_tr1.cc
index 199b8fd5a5a..ac320696ad2 100644
--- a/libstdc++-v3/src/c++98/hashtable_tr1.cc
+++ b/libstdc++-v3/src/c++98/hashtable_tr1.cc
@@ -26,8 +26,12 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace tr1
{
#include "../shared/hashtable-aux.cc"
}
+
+_GLIBCXX_END_NAMESPACE_VERSION
}
diff --git a/libstdc++-v3/src/c++98/list.cc b/libstdc++-v3/src/c++98/list.cc
index 3de7d2d0e02..25e72717eca 100644
--- a/libstdc++-v3/src/c++98/list.cc
+++ b/libstdc++-v3/src/c++98/list.cc
@@ -52,10 +52,10 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
namespace __detail
{
- _GLIBCXX_BEGIN_NAMESPACE_VERSION
-
void
_List_node_base::swap(_List_node_base& __x,
_List_node_base& __y) _GLIBCXX_USE_NOEXCEPT
@@ -141,7 +141,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
__prev_node->_M_next = __next_node;
__next_node->_M_prev = __prev_node;
}
-
- _GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
+
+_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std
diff --git a/libstdc++-v3/src/shared/hashtable-aux.cc b/libstdc++-v3/src/shared/hashtable-aux.cc
index 01c01fa3155..f1d19974bd7 100644
--- a/libstdc++-v3/src/shared/hashtable-aux.cc
+++ b/libstdc++-v3/src/shared/hashtable-aux.cc
@@ -24,7 +24,6 @@
namespace __detail
{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
// The sentinel value is kept only for abi backward compatibility.
extern const unsigned long __prime_list[] = // 256 + 1 or 256 + 48 + 1
{
@@ -90,5 +89,4 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
18446744073709551557ul, 18446744073709551557ul
#endif
};
-_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
diff --git a/libstdc++-v3/testsuite/20_util/duration/literals/range.cc b/libstdc++-v3/testsuite/20_util/duration/literals/range.cc
index c0d1a6e5885..b5105dff38b 100644
--- a/libstdc++-v3/testsuite/20_util/duration/literals/range.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/literals/range.cc
@@ -26,6 +26,6 @@ test01()
// std::numeric_limits<int64_t>::max() == 9223372036854775807;
auto h = 9223372036854775808h;
- // { dg-error "cannot be represented" "" { target *-*-* } 892 }
+ // { dg-error "cannot be represented" "" { target *-*-* } 880 }
}
// { dg-prune-output "in constexpr expansion" } // needed for -O0
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
index 189e97bf984..17f74187098 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
@@ -30,4 +30,4 @@ void test01()
test_type d; // { dg-error "required from here" }
}
-// { dg-error "rep cannot be a duration" "" { target *-*-* } 308 }
+// { dg-error "rep cannot be a duration" "" { target *-*-* } 300 }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
index 501de5ee752..282a9dbdc85 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
@@ -31,5 +31,5 @@ void test01()
test_type d; // { dg-error "required from here" }
}
-// { dg-error "must be a specialization of ratio" "" { target *-*-* } 309 }
+// { dg-error "must be a specialization of ratio" "" { target *-*-* } 301 }
// { dg-prune-output "not a member" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
index a56bb96f5d0..c57f9d947a5 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
@@ -32,4 +32,4 @@ void test01()
test_type d; // { dg-error "required from here" }
}
-// { dg-error "period must be positive" "" { target *-*-* } 311 }
+// { dg-error "period must be positive" "" { target *-*-* } 303 }
diff --git a/libstdc++-v3/testsuite/20_util/forward/c_neg.cc b/libstdc++-v3/testsuite/20_util/forward/c_neg.cc
index c7830d7b2d4..d098164c0f7 100644
--- a/libstdc++-v3/testsuite/20_util/forward/c_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/forward/c_neg.cc
@@ -17,7 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-error "static assertion failed" "" { target *-*-* } 86 }
+// { dg-error "static assertion failed" "" { target *-*-* } 87 }
#include <list>
diff --git a/libstdc++-v3/testsuite/20_util/forward/f_neg.cc b/libstdc++-v3/testsuite/20_util/forward/f_neg.cc
index 7d073fe822b..0ca36d4b5a6 100644
--- a/libstdc++-v3/testsuite/20_util/forward/f_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/forward/f_neg.cc
@@ -17,7 +17,7 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
-// { dg-error "static assertion failed" "" { target *-*-* } 86 }
+// { dg-error "static assertion failed" "" { target *-*-* } 87 }
#include <utility>
diff --git a/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc b/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc
index d80c1259c02..39d3e76ee82 100644
--- a/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc
+++ b/libstdc++-v3/testsuite/20_util/specialized_algorithms/memory_management_tools/1.cc
@@ -180,6 +180,7 @@ void test12()
std::uninitialized_default_construct(target, target+10);
} catch (...) {
}
+ free(target);
VERIFY(ctor_count == 5);
VERIFY(del_count == 5);
throw_after = 0;
@@ -198,6 +199,7 @@ void test13()
std::uninitialized_value_construct(target, target+10);
} catch (...) {
}
+ free(target);
VERIFY(ctor_count == 5);
VERIFY(del_count == 5);
throw_after = 0;
@@ -216,6 +218,7 @@ void test14()
std::uninitialized_default_construct_n(target, 10);
} catch (...) {
}
+ free(target);
VERIFY(ctor_count == 5);
VERIFY(del_count == 5);
throw_after = 0;
@@ -234,6 +237,7 @@ void test15()
std::uninitialized_value_construct_n(target, 10);
} catch (...) {
}
+ free(target);
VERIFY(ctor_count == 5);
VERIFY(del_count == 5);
throw_after = 0;
@@ -254,6 +258,7 @@ void test16()
std::uninitialized_move(source.begin(), source.end(), target);
} catch (...) {
}
+ free(target);
VERIFY(ctor_count == 5);
VERIFY(del_count == 5);
throw_after = 0;
@@ -273,6 +278,7 @@ void test17()
std::uninitialized_move_n(source.begin(), 10, target);
} catch (...) {
}
+ free(target);
VERIFY(ctor_count == 5);
VERIFY(del_count == 5);
throw_after = 0;
diff --git a/libstdc++-v3/testsuite/20_util/variant/compile.cc b/libstdc++-v3/testsuite/20_util/variant/compile.cc
index 06e8eb31ee8..e5f7538ba42 100644
--- a/libstdc++-v3/testsuite/20_util/variant/compile.cc
+++ b/libstdc++-v3/testsuite/20_util/variant/compile.cc
@@ -88,10 +88,12 @@ void copy_ctor()
{
static_assert(is_copy_constructible_v<variant<int, string>>, "");
static_assert(!is_copy_constructible_v<variant<AllDeleted, string>>, "");
+ static_assert(is_trivially_copy_constructible_v<variant<int>>, "");
+ static_assert(!is_trivially_copy_constructible_v<variant<std::string>>, "");
{
variant<int> a;
- static_assert(!noexcept(variant<int>(a)), "");
+ static_assert(noexcept(variant<int>(a)), "");
}
{
variant<string> a;
@@ -103,7 +105,7 @@ void copy_ctor()
}
{
variant<int, char> a;
- static_assert(!noexcept(variant<int, char>(a)), "");
+ static_assert(noexcept(variant<int, char>(a)), "");
}
}
@@ -111,6 +113,8 @@ void move_ctor()
{
static_assert(is_move_constructible_v<variant<int, string>>, "");
static_assert(!is_move_constructible_v<variant<AllDeleted, string>>, "");
+ static_assert(is_trivially_move_constructible_v<variant<int>>, "");
+ static_assert(!is_trivially_move_constructible_v<variant<std::string>>, "");
static_assert(!noexcept(variant<int, Empty>(declval<variant<int, Empty>>())), "");
static_assert(noexcept(variant<int, DefaultNoexcept>(declval<variant<int, DefaultNoexcept>>())), "");
}
@@ -148,13 +152,15 @@ void copy_assign()
{
static_assert(is_copy_assignable_v<variant<int, string>>, "");
static_assert(!is_copy_assignable_v<variant<AllDeleted, string>>, "");
+ static_assert(is_trivially_copy_assignable_v<variant<int>>, "");
+ static_assert(!is_trivially_copy_assignable_v<variant<string>>, "");
{
variant<Empty> a;
static_assert(!noexcept(a = a), "");
}
{
variant<DefaultNoexcept> a;
- static_assert(!noexcept(a = a), "");
+ static_assert(noexcept(a = a), "");
}
}
@@ -162,6 +168,8 @@ void move_assign()
{
static_assert(is_move_assignable_v<variant<int, string>>, "");
static_assert(!is_move_assignable_v<variant<AllDeleted, string>>, "");
+ static_assert(is_trivially_move_assignable_v<variant<int>>, "");
+ static_assert(!is_trivially_move_assignable_v<variant<string>>, "");
{
variant<Empty> a;
static_assert(!noexcept(a = std::move(a)), "");
@@ -454,3 +462,92 @@ void test_emplace()
static_assert(!has_type_emplace<variant<AllDeleted>, AllDeleted>(0), "");
static_assert(!has_index_emplace<variant<AllDeleted>, 0>(0), "");
}
+
+void test_triviality()
+{
+#define TEST_TEMPLATE(DT, CC, MC, CA, MA, CC_VAL, MC_VAL, CA_VAL, MA_VAL) \
+ { \
+ struct A \
+ { \
+ ~A() DT; \
+ A(const A&) CC; \
+ A(A&&) MC; \
+ A& operator=(const A&) CA; \
+ A& operator=(A&&) MA; \
+ }; \
+ static_assert(CC_VAL == is_trivially_copy_constructible_v<variant<A>>, ""); \
+ static_assert(MC_VAL == is_trivially_move_constructible_v<variant<A>>, ""); \
+ static_assert(CA_VAL == is_trivially_copy_assignable_v<variant<A>>, ""); \
+ static_assert(MA_VAL == is_trivially_move_assignable_v<variant<A>>, ""); \
+ }
+ TEST_TEMPLATE(=default, =default, =default, =default, =default, true, true, true, true)
+ TEST_TEMPLATE(=default, =default, =default, =default, {}, true, true, true, false)
+ TEST_TEMPLATE(=default, =default, =default, {}, =default, true, true, false, true)
+ TEST_TEMPLATE(=default, =default, =default, {}, {}, true, true, false, false)
+ TEST_TEMPLATE(=default, =default, {}, =default, =default, true, false, true, true)
+ TEST_TEMPLATE(=default, =default, {}, =default, {}, true, false, true, false)
+ TEST_TEMPLATE(=default, =default, {}, {}, =default, true, false, false, true)
+ TEST_TEMPLATE(=default, =default, {}, {}, {}, true, false, false, false)
+ TEST_TEMPLATE(=default, {}, =default, =default, =default, false, true, true, true)
+ TEST_TEMPLATE(=default, {}, =default, =default, {}, false, true, true, false)
+ TEST_TEMPLATE(=default, {}, =default, {}, =default, false, true, false, true)
+ TEST_TEMPLATE(=default, {}, =default, {}, {}, false, true, false, false)
+ TEST_TEMPLATE(=default, {}, {}, =default, =default, false, false, true, true)
+ TEST_TEMPLATE(=default, {}, {}, =default, {}, false, false, true, false)
+ TEST_TEMPLATE(=default, {}, {}, {}, =default, false, false, false, true)
+ TEST_TEMPLATE(=default, {}, {}, {}, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, =default, =default, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, =default, =default, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, =default, {}, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, =default, {}, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, {}, =default, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, {}, =default, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, {}, {}, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, =default, {}, {}, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, =default, =default, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, =default, =default, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, =default, {}, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, =default, {}, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, {}, =default, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, {}, =default, {}, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, {}, {}, =default, false, false, false, false)
+ TEST_TEMPLATE( {}, {}, {}, {}, {}, false, false, false, false)
+#undef TEST_TEMPLATE
+
+#define TEST_TEMPLATE(CC, MC, CA, MA) \
+ { \
+ struct A \
+ { \
+ A(const A&) CC; \
+ A(A&&) MC; \
+ A& operator=(const A&) CA; \
+ A& operator=(A&&) MA; \
+ }; \
+ static_assert(!is_trivially_copy_constructible_v<variant<AllDeleted, A>>, ""); \
+ static_assert(!is_trivially_move_constructible_v<variant<AllDeleted, A>>, ""); \
+ static_assert(!is_trivially_copy_assignable_v<variant<AllDeleted, A>>, ""); \
+ static_assert(!is_trivially_move_assignable_v<variant<AllDeleted, A>>, ""); \
+ }
+ TEST_TEMPLATE(=default, =default, =default, =default)
+ TEST_TEMPLATE(=default, =default, =default, {})
+ TEST_TEMPLATE(=default, =default, {}, =default)
+ TEST_TEMPLATE(=default, =default, {}, {})
+ TEST_TEMPLATE(=default, {}, =default, =default)
+ TEST_TEMPLATE(=default, {}, =default, {})
+ TEST_TEMPLATE(=default, {}, {}, =default)
+ TEST_TEMPLATE(=default, {}, {}, {})
+ TEST_TEMPLATE( {}, =default, =default, =default)
+ TEST_TEMPLATE( {}, =default, =default, {})
+ TEST_TEMPLATE( {}, =default, {}, =default)
+ TEST_TEMPLATE( {}, =default, {}, {})
+ TEST_TEMPLATE( {}, {}, =default, =default)
+ TEST_TEMPLATE( {}, {}, =default, {})
+ TEST_TEMPLATE( {}, {}, {}, =default)
+ TEST_TEMPLATE( {}, {}, {}, {})
+#undef TEST_TEMPLATE
+
+ static_assert(is_trivially_copy_constructible_v<variant<DefaultNoexcept, int, char, float, double>>, "");
+ static_assert(is_trivially_move_constructible_v<variant<DefaultNoexcept, int, char, float, double>>, "");
+ static_assert(is_trivially_copy_assignable_v<variant<DefaultNoexcept, int, char, float, double>>, "");
+ static_assert(is_trivially_move_assignable_v<variant<DefaultNoexcept, int, char, float, double>>, "");
+}
diff --git a/libstdc++-v3/testsuite/20_util/variant/deduction.cc b/libstdc++-v3/testsuite/20_util/variant/deduction.cc
new file mode 100644
index 00000000000..33bc9d2a40e
--- /dev/null
+++ b/libstdc++-v3/testsuite/20_util/variant/deduction.cc
@@ -0,0 +1,39 @@
+// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++1z } }
+
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <variant>
+
+template<typename T, typename U> struct require_same;
+template<typename T> struct require_same<T, T> { using type = void; };
+
+template<typename T, typename U>
+ typename require_same<T, U>::type
+ check_type(U&) { }
+
+void
+test01()
+{
+ std::variant<int, double> x(3);
+
+ std::variant copy = x;
+ check_type<decltype(x)>(copy);
+ std::variant move = std::move(x);
+ check_type<decltype(x)>(move);
+}
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
index 4c23c7f60e2..c0a18ce5d5c 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/5.cc
@@ -37,34 +37,7 @@ void test04()
#ifdef _GLIBCXX_HAVE_SETENV
- const char* LANG_orig = getenv("LANG") ? strdup(getenv("LANG")) : "";
- const char* LC_ALL_orig = getenv("LC_ALL") ? strdup(getenv("LC_ALL")) : "";
- const char* LC_CTYPE_orig =
- getenv("LC_CTYPE") ? strdup(getenv("LC_CTYPE")) : "";
- const char* LC_NUMERIC_orig =
- getenv("LC_NUMERIC") ? strdup(getenv("LC_NUMERIC")) : "";
- const char* LC_TIME_orig =
- getenv("LC_TIME") ? strdup(getenv("LC_TIME")) : "";
- const char* LC_COLLATE_orig =
- getenv("LC_COLLATE") ? strdup(getenv("LC_COLLATE")) : "";
- const char* LC_MONETARY_orig =
- getenv("LC_MONETARY") ? strdup(getenv("LC_MONETARY")) : "";
- const char* LC_MESSAGES_orig =
- getenv("LC_MESSAGES") ? strdup(getenv("LC_MESSAGES")) : "";
-#if _GLIBCXX_NUM_CATEGORIES
- const char* LC_PAPER_orig =
- getenv("LC_PAPER") ? strdup(getenv("LC_PAPER")) : "";
- const char* LC_NAME_orig =
- getenv("LC_NAME") ? strdup(getenv("LC_NAME")) : "";
- const char* LC_ADDRESS_orig =
- getenv("LC_ADDRESS") ? strdup(getenv("LC_ADDRESS")) : "";
- const char* LC_TELEPHONE_orig =
- getenv("LC_TELEPHONE") ? strdup(getenv("LC_TELEPHONE")) : "";
- const char* LC_MEASUREMENT_orig =
- getenv("LC_MEASUREMENT") ? strdup(getenv("LC_MEASUREMENT")) : "";
- const char* LC_IDENTIFICATION_orig =
- getenv("LC_IDENTIFICATION") ? strdup(getenv("LC_IDENTIFICATION")) : "";
-#endif
+ char* LANG_orig = strdup(getenv("LANG") ? getenv("LANG") : "");
// Check that a "POSIX" LC_ALL is equivalent to "C".
if (!setenv("LC_ALL", "POSIX", 1))
@@ -91,12 +64,11 @@ void test04()
VERIFY( loc.name() == "en_PH" );
}
setenv("LC_ALL", "", 1);
- setenv("LANG", LANG_orig ? LANG_orig : "", 1);
- setenv("LC_COLLATE", LC_COLLATE_orig ? LC_COLLATE_orig : "", 1);
+ setenv("LANG", LANG_orig, 1);
}
// NB: LANG checks all LC_* macro settings. As such, all LC_* macros
- // must be cleared for these tests, and then restored.
+ // must be cleared for these tests.
setenv("LC_ALL", "", 1);
setenv("LC_CTYPE", "", 1);
setenv("LC_NUMERIC", "", 1);
@@ -173,26 +145,9 @@ void test04()
}
#endif
- // Restore the environment.
- setenv("LANG", LANG_orig ? LANG_orig : "", 1);
- setenv("LC_ALL", LC_ALL_orig ? LC_ALL_orig : "", 1);
- setenv("LC_CTYPE", LC_CTYPE_orig ? LC_CTYPE_orig : "", 1);
- setenv("LC_NUMERIC", LC_NUMERIC_orig ? LC_NUMERIC_orig : "", 1);
- setenv("LC_TIME", LC_TIME_orig ? LC_TIME_orig : "", 1);
- setenv("LC_COLLATE", LC_COLLATE_orig ? LC_COLLATE_orig : "", 1);
- setenv("LC_MONETARY", LC_MONETARY_orig ? LC_MONETARY_orig : "", 1);
- setenv("LC_MESSAGES", LC_MESSAGES_orig ? LC_MESSAGES_orig : "", 1);
-#if _GLIBCXX_NUM_CATEGORIES
- setenv("LC_PAPER", LC_PAPER_orig ? LC_PAPER_orig : "", 1);
- setenv("LC_NAME", LC_NAME_orig ? LC_NAME_orig : "", 1);
- setenv("LC_ADDRESS", LC_ADDRESS_orig ? LC_ADDRESS_orig : "", 1);
- setenv("LC_TELEPHONE", LC_TELEPHONE_orig ? LC_TELEPHONE_orig : "", 1);
- setenv("LC_MEASUREMENT", LC_MEASUREMENT_orig ? LC_MEASUREMENT_orig : "", 1);
- setenv("LC_IDENTIFICATION",
- LC_IDENTIFICATION_orig ? LC_IDENTIFICATION_orig : "", 1);
-#endif
+ free(LANG_orig);
-#endif
+#endif // _GLIBCXX_HAVE_SETENV
}
int main()
diff --git a/libstdc++-v3/testsuite/23_containers/list/allocator/default_init.cc b/libstdc++-v3/testsuite/23_containers/list/allocator/default_init.cc
new file mode 100644
index 00000000000..0604e067252
--- /dev/null
+++ b/libstdc++-v3/testsuite/23_containers/list/allocator/default_init.cc
@@ -0,0 +1,71 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do run { target c++11 } }
+// { dg-options "-O0" }
+// { dg-xfail-run-if "PR c++/65816" { *-*-* } }
+
+#include <list>
+#include <testsuite_hooks.h>
+#include <testsuite_allocator.h>
+
+#include <ext/aligned_buffer.h>
+
+using T = int;
+
+using __gnu_test::default_init_allocator;
+
+void test01()
+{
+ typedef default_init_allocator<T> alloc_type;
+ typedef std::list<T, alloc_type> test_type;
+
+ __gnu_cxx::__aligned_buffer<test_type> buf;
+ __builtin_memset(buf._M_addr(), ~0, sizeof(test_type));
+
+ VERIFY( buf._M_ptr()->get_allocator().state != 0 );
+
+ test_type *tmp = ::new(buf._M_addr()) test_type();
+
+ VERIFY( tmp->get_allocator().state == 0 );
+
+ tmp->~test_type();
+}
+
+void test02()
+{
+ typedef default_init_allocator<T> alloc_type;
+ typedef std::list<T, alloc_type> test_type;
+
+ __gnu_cxx::__aligned_buffer<test_type> buf;
+ __builtin_memset(buf._M_addr(), ~0, sizeof(test_type));
+
+ VERIFY( buf._M_ptr()->get_allocator().state != 0 );
+
+ test_type *tmp = ::new(buf._M_addr()) test_type;
+
+ VERIFY( tmp->get_allocator().state == 0 );
+
+ tmp->~test_type();
+}
+
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/25_algorithms/sample/81221.cc b/libstdc++-v3/testsuite/25_algorithms/sample/81221.cc
new file mode 100644
index 00000000000..28ec0e3152a
--- /dev/null
+++ b/libstdc++-v3/testsuite/25_algorithms/sample/81221.cc
@@ -0,0 +1,22 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++1z } }
+// { dg-require-parallel-mode "" }
+
+#include <algorithm>
diff --git a/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc b/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc
index d88f145d754..8c3494d7041 100644
--- a/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc
+++ b/libstdc++-v3/testsuite/26_numerics/gcd/gcd_neg.cc
@@ -31,9 +31,9 @@ test01()
std::gcd(0.1, 0.1); // { dg-error "from here" }
}
-// { dg-error "integers" "" { target *-*-* } 134 }
-// { dg-error "integers" "" { target *-*-* } 135 }
-// { dg-error "not bools" "" { target *-*-* } 136 }
-// { dg-error "not bools" "" { target *-*-* } 137 }
+// { dg-error "integers" "" { target *-*-* } 130 }
+// { dg-error "integers" "" { target *-*-* } 131 }
+// { dg-error "not bools" "" { target *-*-* } 132 }
+// { dg-error "not bools" "" { target *-*-* } 133 }
// { dg-prune-output "deleted function" }
// { dg-prune-output "invalid operands" }
diff --git a/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc b/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc
index f2d82894531..abcac4f18c1 100644
--- a/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc
+++ b/libstdc++-v3/testsuite/26_numerics/lcm/lcm_neg.cc
@@ -31,9 +31,9 @@ test01()
std::lcm(0.1, 0.1); // { dg-error "from here" }
}
-// { dg-error "integers" "" { target *-*-* } 147 }
-// { dg-error "integers" "" { target *-*-* } 148 }
-// { dg-error "not bools" "" { target *-*-* } 149 }
-// { dg-error "not bools" "" { target *-*-* } 150 }
+// { dg-error "integers" "" { target *-*-* } 143 }
+// { dg-error "integers" "" { target *-*-* } 144 }
+// { dg-error "not bools" "" { target *-*-* } 145 }
+// { dg-error "not bools" "" { target *-*-* } 146 }
// { dg-prune-output "deleted function" }
// { dg-prune-output "invalid operands" }
diff --git a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc
index ad2cbc6e71b..22485222f28 100644
--- a/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc
+++ b/libstdc++-v3/testsuite/26_numerics/random/pr60037-neg.cc
@@ -9,6 +9,6 @@ std::__detail::_Adaptor<std::mt19937, unsigned long> aurng(urng);
auto x = std::generate_canonical<std::size_t,
std::numeric_limits<std::size_t>::digits>(urng);
-// { dg-error "static assertion failed: template argument must be a floating point type" "" { target *-*-* } 160 }
+// { dg-error "static assertion failed: template argument must be a floating point type" "" { target *-*-* } 156 }
-// { dg-error "static assertion failed: template argument must be a floating point type" "" { target *-*-* } 3314 }
+// { dg-error "static assertion failed: template argument must be a floating point type" "" { target *-*-* } 3311 }
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/81395.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/81395.cc
new file mode 100644
index 00000000000..ea8dbc1259b
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/81395.cc
@@ -0,0 +1,46 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-fileio "" }
+
+// PR libstdc++/81395
+
+#include <fstream>
+#include <cstring> // for std::memset
+#include <cstdio> // For BUFSIZ
+
+using std::memset;
+
+int main()
+{
+ {
+ std::filebuf fb;
+ fb.open("test.txt", std::ios::out);
+ char data[BUFSIZ];
+ memset(data, 'A', sizeof(data));
+ fb.sputn(data, sizeof(data));
+ }
+
+ std::filebuf fb;
+ fb.open("test.txt", std::ios::in|std::ios::out);
+ char buf[BUFSIZ];
+ memset(buf, 0, sizeof(buf));
+ fb.sgetn(buf, sizeof(buf));
+ // Switch from reading to writing without seeking first:
+ fb.sputn("B", 1);
+ fb.pubsync();
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc
new file mode 100644
index 00000000000..e49d2b1ad1f
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_fstream/53984.cc
@@ -0,0 +1,39 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-require-fileio "" }
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::ifstream in(".");
+ if (in)
+ {
+ int x;
+ in >> x;
+ VERIFY( in.bad() );
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/53984.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/53984.cc
new file mode 100644
index 00000000000..9c08c7236da
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/53984.cc
@@ -0,0 +1,41 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+#include <streambuf>
+#include <istream>
+#include <testsuite_hooks.h>
+
+struct SB : std::streambuf
+{
+ virtual int_type underflow() { throw 1; }
+};
+
+void
+test01()
+{
+ SB sb;
+ std::istream is(&sb);
+ int i;
+ is >> i;
+ VERIFY( is.bad() );
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/81381.cc b/libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/81381.cc
new file mode 100644
index 00000000000..865449d72ee
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_stringbuf/cons/81381.cc
@@ -0,0 +1,42 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do run { target c++11 } }
+
+// PR libstdc++/81381
+
+#include <memory>
+#include <sstream>
+#include <testsuite_allocator.h>
+
+using Alloc = __gnu_test::uneq_allocator<char>;
+using String = std::basic_string<char, std::char_traits<char>, Alloc>;
+
+struct SB : std::basic_stringbuf<char, std::char_traits<char>, Alloc>
+{
+ SB(const String& s) : basic_stringbuf(s) { }
+
+ using basic_stringbuf::overflow;
+};
+
+int main()
+{
+ String s(Alloc(23));
+ SB b(s);
+ b.overflow('a');
+ VERIFY( b.str().get_allocator() == s.get_allocator() );
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_stringstream/assign/81338.cc b/libstdc++-v3/testsuite/27_io/basic_stringstream/assign/81338.cc
new file mode 100644
index 00000000000..30370c0dd42
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_stringstream/assign/81338.cc
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do run { target c++11 } }
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void
+test01()
+{
+ std::stringstream ss;
+ for (int i = 0; i < 100; ++i)
+ {
+ ss << 'a';
+ VERIFY( static_cast<bool>(ss) );
+ VERIFY( ss.str() == "a" );
+ ss = std::stringstream();
+ }
+}
+
+int
+main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/27_io/types/1.cc b/libstdc++-v3/testsuite/27_io/types/1.cc
index 88f6ff868d7..0756f8a1709 100644
--- a/libstdc++-v3/testsuite/27_io/types/1.cc
+++ b/libstdc++-v3/testsuite/27_io/types/1.cc
@@ -15,6 +15,8 @@
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
+// { dg-do compile { target c++14_down } }
+
// 27.4.2.1 - Types [lib.ios.types]
#include <ios>
@@ -27,9 +29,3 @@ void test01()
typedef std::ios_base::streampos streampos_type;
typedef std::ios_base::streamoff streamoff_type;
}
-
-int main(void)
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/27_io/types/4.cc b/libstdc++-v3/testsuite/27_io/types/4.cc
new file mode 100644
index 00000000000..ee1a77736ce
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/types/4.cc
@@ -0,0 +1,29 @@
+// Copyright (C) 2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17" }
+// { dg-do compile { target c++1z } }
+
+// In C++17 these names are not reserved by the library.
+#define io_state 1
+#define open_mode 2
+#define seek_dir 3
+#define stossc 4
+#include <streambuf>
+
+template class std::basic_streambuf<char>;
+template class std::basic_streambuf<wchar_t>;
diff --git a/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/1.cc b/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/1.cc
index 9f1b48c809a..e420ab08378 100644
--- a/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/1.cc
+++ b/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/1.cc
@@ -79,7 +79,7 @@ void test01()
try
{
- std::scoped_lock<BasicLockable> l(m, std::adopt_lock);
+ std::scoped_lock<BasicLockable> l(std::adopt_lock, m);
}
catch (...)
{
@@ -113,7 +113,7 @@ void test02()
try
{
- std::scoped_lock<Lockable<1>, Lockable<2>> l(m1, m2, std::adopt_lock);
+ std::scoped_lock<Lockable<1>, Lockable<2>> l(std::adopt_lock, m1, m2);
VERIFY( m1.m.locked );
VERIFY( m2.m.locked );
}
diff --git a/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/deduction.cc b/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/deduction.cc
index 399de7a5ae6..7d4f5bfc386 100644
--- a/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/deduction.cc
+++ b/libstdc++-v3/testsuite/30_threads/scoped_lock/cons/deduction.cc
@@ -51,3 +51,28 @@ test01()
std::scoped_lock l2(m2, m3);
check_type<std::scoped_lock<Lockable, std::mutex>>(l2);
}
+
+void
+test02()
+{
+ std::scoped_lock l0(std::adopt_lock);
+ check_type<std::scoped_lock<>>(l0);
+
+ struct BasicLockable {
+ void lock() { }
+ void unlock() { }
+ } m1;
+
+ std::scoped_lock l1(std::adopt_lock, m1);
+ check_type<std::scoped_lock<BasicLockable>>(l1);
+
+ struct Lockable {
+ void lock() { }
+ void unlock() { }
+ bool try_lock() { return true; }
+ } m2;
+
+ std::mutex m3;
+ std::scoped_lock l2(std::adopt_lock, m2, m3);
+ check_type<std::scoped_lock<Lockable, std::mutex>>(l2);
+}
diff --git a/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc b/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc
index 55756d87262..0a8903ebaab 100644
--- a/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc
+++ b/libstdc++-v3/testsuite/30_threads/scoped_lock/requirements/typedefs.cc
@@ -25,6 +25,12 @@
#include <mutex>
+#ifndef __cpp_lib_scoped_lock
+# error "Feature-test macro for scoped_lock missing"
+#elif __cpp_lib_scoped_lock != 201707
+# error "Feature-test macro for scoped_lock has wrong value"
+#endif
+
void test01()
{
// Check for required typedefs
diff --git a/libstdc++-v3/testsuite/abi/pr42230.cc b/libstdc++-v3/testsuite/abi/pr42230.cc
index 2a338995336..48156e4ba18 100644
--- a/libstdc++-v3/testsuite/abi/pr42230.cc
+++ b/libstdc++-v3/testsuite/abi/pr42230.cc
@@ -3,6 +3,7 @@
#include <cxxabi.h>
#include <cassert>
#include <cstddef>
+#include <cstdlib>
int main()
{
@@ -12,5 +13,6 @@ int main()
char* ret = abi::__cxa_demangle("e", 0, &length, &cc);
assert( (cc < 0 && !ret) || (ret && length) );
+ std::free(ret);
return 0;
}
diff --git a/libstdc++-v3/testsuite/performance/23_containers/insert/81476.cc b/libstdc++-v3/testsuite/performance/23_containers/insert/81476.cc
new file mode 100644
index 00000000000..2b76469ae11
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/23_containers/insert/81476.cc
@@ -0,0 +1,86 @@
+// Copyright (C) 2012-2017 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-do run { target c++11 } }
+
+#include <random>
+#include <vector>
+#include <testsuite_hooks.h>
+#include <testsuite_performance.h>
+
+int main()
+{
+ using namespace __gnu_test;
+
+ std::default_random_engine eng;
+ std::uniform_int_distribution<unsigned> r(0, 127);
+
+ time_counter time;
+ resource_counter resource;
+
+ std::vector<std::vector<char>> vecs(10000);
+ for (auto& v : vecs)
+ {
+ v.resize(1000);
+ for (auto& c : v)
+ c = r(eng);
+ }
+
+ start_counters(time, resource);
+ std::vector<char> res;
+ for (auto& v : vecs)
+ res.insert(res.begin(), v.begin(), v.end());
+ stop_counters(time, resource);
+ report_performance(__FILE__, "insert pointers", time, resource);
+
+ struct input_iterator : std::vector<char>::iterator
+ {
+ using iterator_category = std::input_iterator_tag;
+ using base = std::vector<char>::iterator;
+
+ input_iterator(base it) : base(it) { }
+ };
+
+ start_counters(time, resource);
+ std::vector<char> res2;
+ for (auto& v : vecs)
+ {
+ auto begin = input_iterator(v.begin());
+ auto end = input_iterator(v.end());
+ res2.insert(res2.begin(), begin, end);
+ }
+ stop_counters(time, resource);
+ report_performance(__FILE__, "insert input iterators", time, resource);
+
+ start_counters(time, resource);
+ std::vector<char> res3;
+ for (auto rev = vecs.rbegin(); rev != vecs.rend(); ++rev)
+ res3.insert(res3.end(), rev->begin(), rev->end());
+ stop_counters(time, resource);
+ report_performance(__FILE__, "insert pointers end", time, resource);
+
+ start_counters(time, resource);
+ std::vector<char> res4;
+ for (auto rev = vecs.rbegin(); rev != vecs.rend(); ++rev)
+ res4.insert(res4.end(), rev->begin(), rev->end());
+ stop_counters(time, resource);
+ report_performance(__FILE__, "insert input iterators end", time, resource);
+
+ VERIFY(res2 == res);
+ VERIFY(res3 == res);
+ VERIFY(res4 == res);
+}
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc
index 4d7f4ca3a65..d18429a55b2 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc
@@ -590,21 +590,26 @@ create_symbols(const char* file)
}
-const char*
+std::string
demangle(const std::string& mangled)
{
- const char* name;
+ std::string name;
if (mangled[0] != '_' || mangled[1] != 'Z')
{
// This is not a mangled symbol, thus has "C" linkage.
- name = mangled.c_str();
+ name = mangled;
}
else
{
// Use __cxa_demangle to demangle.
int status = 0;
- name = abi::__cxa_demangle(mangled.c_str(), 0, 0, &status);
- if (!name)
+ char* ptr = abi::__cxa_demangle(mangled.c_str(), 0, 0, &status);
+ if (ptr)
+ {
+ name = ptr;
+ free(ptr);
+ }
+ else
{
switch (status)
{
diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.h b/libstdc++-v3/testsuite/util/testsuite_abi.h
index 8275b23e162..77c5656177f 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.h
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.h
@@ -94,5 +94,5 @@ compare_symbols(const char* baseline_file, const char* test_file, bool verb);
symbols
create_symbols(const char* file);
-const char*
+std::string
demangle(const std::string& mangled);
diff --git a/libstdc++-v3/testsuite/util/testsuite_hooks.cc b/libstdc++-v3/testsuite/util/testsuite_hooks.cc
index d1063e3d8d7..74e755dfe28 100644
--- a/libstdc++-v3/testsuite/util/testsuite_hooks.cc
+++ b/libstdc++-v3/testsuite/util/testsuite_hooks.cc
@@ -131,8 +131,11 @@ namespace __gnu_test
verify_demangle(const char* mangled, const char* wanted)
{
int status = 0;
- const char* s = abi::__cxa_demangle(mangled, 0, 0, &status);
- if (!s)
+ const char* s = 0;
+ char* demangled = abi::__cxa_demangle(mangled, 0, 0, &status);
+ if (demangled)
+ s = demangled;
+ else
{
switch (status)
{
@@ -156,6 +159,7 @@ namespace __gnu_test
std::string w(wanted);
if (w != s)
std::__throw_runtime_error(s);
+ free(demangled);
}
void
diff --git a/libstdc++-v3/testsuite/util/testsuite_iterators.h b/libstdc++-v3/testsuite/util/testsuite_iterators.h
index 6771ae2cea6..d61b2162c14 100644
--- a/libstdc++-v3/testsuite/util/testsuite_iterators.h
+++ b/libstdc++-v3/testsuite/util/testsuite_iterators.h
@@ -539,14 +539,14 @@ namespace __gnu_test
struct test_container
{
typename ItType<T>::ContainerType bounds;
- test_container(T* _first, T* _last):bounds(_first, _last)
+ test_container(T* _first, T* _last) : bounds(_first, _last)
{ }
#if __cplusplus >= 201103L
- template<std::size_t N>
- explicit
- test_container(T (&arr)[N]) : test_container(arr, arr+N)
- { }
+ template<std::size_t N>
+ explicit
+ test_container(T (&arr)[N]) : test_container(arr, arr+N)
+ { }
#endif
ItType<T>
@@ -574,6 +574,6 @@ namespace __gnu_test
ItType<T>
end()
{ return it(bounds.last); }
- };
+ };
}
#endif