aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
AgeCommit message (Collapse)AuthorFilesLines
2017-07-23re PR libstdc++/81064 (Inline namespace regression)François Dumont11-37/+31
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. From-SVN: r250458
2017-06-152017-06-15 François Dumont <fdumont@gcc.gnu.org>François Dumont1-6/+6
* src/c++98/tree.cc [!_GLIBCXX_INLINE_VERSION] (_Rb_tree_rotate_left, _Rb_tree_rotate_right): Delete. From-SVN: r249226
2017-06-12PR libstdc++/55917 do not handle exceptions in std::threadJonathan Wakely1-28/+2
PR libstdc++/55917 * src/c++11/thread.cc (execute_native_thread_routine): Remove try-block so that exceptions propagate out of the thread and terminate is called by the exception-handling runtime. (execute_native_thread_routine_compat): Likewise. * testsuite/30_threads/thread/cons/terminate.cc: New. From-SVN: r249130
2017-06-03configure.ac (*-*-linux-android*): Set target_makefile_frag.Eric Botcazou1-1/+2
* configure.ac (*-*-linux-android*): Set target_makefile_frag. * configure: Regenerate. config/ * mt-android: New file. libstdc++-v3/ * src/filesystem/dir.cc (fs::_Dir::advance): Use std::exchange. From-SVN: r248853
2017-05-24Use CHAR_BIT instead of assuming 8 bitsJonathan Wakely1-2/+3
* src/c++11/random.cc (random_device::_M_getentropy): Use __CHAR_BIT__ instead of fixed number of bits. From-SVN: r248428
2017-05-23PR libstdc++/67578 Implement non-trivial std::random_device::entropyXi Ruoyao1-0/+35
2017-05-23 Xi Ruoyao <ryxi@stu.xidian.edu.cn> Jonathan Wakely <jwakely@redhat.com> PR libstdc++/67578 * acinclude.m4: Bump libtool_VERSION. * config/abi/pre/gnu.ver: Create GLIBCXX_3.4.24 with new symbol. * config.h.in: Regenerate. * configure: Regenerate. * configure.ac: Add test for <linux/random.h>. * doc/xml/manual/abi.xml: Document new library version. * include/bits/random.h (random_device::entropy) [_GLIBCXX_USE_RANDOM_TR1]: Add call to new _M_getentropy member. (random_device::_M_getentropy): Declare. * src/c++11/random.cc (random_device::_M_getentropy): Define. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.24 to known versions, and make it the latest version. Co-Authored-By: Jonathan Wakely <jwakely@redhat.com> From-SVN: r248374
2017-05-112017-05-11 François Dumont <fdumont@gcc.gnu.org>François Dumont1-0/+3
* include/debug/formatter.h [_GLIBCXX_INLINE_VERSION] (__gnu_debug::_Error_formatter::_Parameter::_M_print_field): Remove. (__gnu_debug::_Error_formatter::_Parameter::_M_print_description): Remove. (__gnu_debug::_Error_formatter::_M_format_word): Remove. (__gnu_debug::_Error_formatter::_M_print_word): Remove. (__gnu_debug::_Error_formatter::_M_print_string): Remove. (__gnu_debug::_Error_formatter::_M_get_max_length): Remove. * src/c++11/debug.cc: Adapt. * config/abi/pre/gnu-versioned-namespace.ver: Adapt. From-SVN: r247925
2017-03-17Fix alignment bugs in std::codecvt_utf16Jonathan Wakely1-157/+235
* src/c++11/codecvt.cc (range): Add non-type template parameter and define oerloaded operators for reading and writing code units. (range<Elem, false>): Define partial specialization for accessing wide characters in potentially unaligned byte ranges. (ucs2_span(const char16_t*, const char16_t*, ...)) (ucs4_span(const char16_t*, const char16_t*, ...)): Change parameters to range<const char16_t, false> in order to avoid unaligned reads. (__codecvt_utf16_base<char16_t>::do_out) (__codecvt_utf16_base<char32_t>::do_out) (__codecvt_utf16_base<wchar_t>::do_out): Use range specialization for unaligned data to avoid unaligned writes. (__codecvt_utf16_base<char16_t>::do_in) (__codecvt_utf16_base<char32_t>::do_in) (__codecvt_utf16_base<wchar_t>::do_in): Likewise for writes. Return error if there are unprocessable trailing bytes. (__codecvt_utf16_base<char16_t>::do_length) (__codecvt_utf16_base<char32_t>::do_length) (__codecvt_utf16_base<wchar_t>::do_length): Pass arguments of type range<const char16_t, false> to span functions. * testsuite/22_locale/codecvt/codecvt_utf16/misaligned.cc: New test. From-SVN: r246245
2017-03-16PR libstdc++/79980 fix target type of castJonathan Wakely1-1/+1
PR libstdc++/79980 * src/c++11/codecvt.cc (to_integer(codecvt_mode)): Fix target type. From-SVN: r246205
2017-03-16PR libstdc++/80041 fix codecvt_utf16<wchar_t> to use UTF-16 not UTF-8Jonathan Wakely1-4/+10
PR libstdc++/80041 * src/c++11/codecvt.cc (__codecvt_utf16_base<wchar_t>::do_out) (__codecvt_utf16_base<wchar_t>::do_in): Convert char arguments to char16_t to work with UTF-16 instead of UTF-8. * testsuite/22_locale/codecvt/codecvt_utf16/80041.cc: New test. From-SVN: r246202
2017-03-16Fix encoding() and max_length() values for codecvt facetsJonathan Wakely1-32/+90
* src/c++11/codecvt.cc (codecvt<char16_t, char, mbstate_t>) (codecvt<char32_t, char, mbstate_t>, __codecvt_utf8_base<char16_t>) (__codecvt_utf8_base<char32_t>, __codecvt_utf8_base<wchar_t>) (__codecvt_utf16_base<char16_t>, __codecvt_utf16_base<char32_t>) (__codecvt_utf16_base<wchar_t>, __codecvt_utf8_utf16_base<char16_t>) (__codecvt_utf8_utf16_base<char32_t>) (__codecvt_utf8_utf16_base<wchar_t>): Fix do_encoding() and do_max_length() return values. * testsuite/22_locale/codecvt/codecvt_utf16/members.cc: New test. * testsuite/22_locale/codecvt/codecvt_utf8/members.cc: New test. * testsuite/22_locale/codecvt/codecvt_utf8_utf16/members.cc: New test. From-SVN: r246201
2017-03-16PR libstdc++/79980 fix BOM detection, maxcode checks, UCS2 handlingJonathan Wakely1-30/+64
PR libstdc++/79980 * include/bits/locale_conv.h (__do_str_codecvt): Set __count on error path. * src/c++11/codecvt.cc (operator&=, operator|=, operator~): Overloads for manipulating codecvt_mode values. (read_utf16_bom): Compare input to BOM constants instead of integral constants that depend on endianness. Take mode parameter by reference and adjust it, to distinguish between no BOM present and UTF-16BE BOM present. (ucs4_in, ucs2_span, ucs4_span): Adjust calls to read_utf16_bom. (surrogates): New enumeration type. (utf16_in, utf16_out): Add surrogates parameter to choose between UTF-16 and UCS2 behaviour. (utf16_span, ucs2_span): Use std::min not std::max. (ucs2_out): Use std::min not std::max. Disallow surrogate pairs. (ucs2_in): Likewise. Adjust calls to read_utf16_bom. * testsuite/22_locale/codecvt/codecvt_utf16/79980.cc: New test. * testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: New test. From-SVN: r246200
2017-03-16PR libstdc++/79511 fix endianness of UTF-16 dataJonathan Wakely1-3/+11
PR libstdc++/79511 * src/c++11/codecvt.cc (write_utf16_code_point): Don't write 0xffff as a surrogate pair. (__codecvt_utf8_utf16_base<char32_t>::do_in): Use native endianness for internal representation. (__codecvt_utf8_utf16_base<wchar_t>::do_in): Likewise. * testsuite/22_locale/codecvt/codecvt_utf8_utf16/79511.cc: New test. From-SVN: r246199
2017-02-16PR libstdc++/60936 fix length calculationJonathan Wakely1-1/+1
PR libstdc++/60936 * src/c++11/snprintf_lite.cc (__concat_size_t): Calculate length written to buffer, not length remaining in buffer. From-SVN: r245505
2017-02-08* src/c++11/snprintf_lite.cc (__err): Use https for bug reporting.Gerald Pfeifer1-1/+1
From-SVN: r245288
2017-02-08* src/c++11/snprintf_lite.cc (__err): Update bug reporting URL.Gerald Pfeifer1-1/+1
From-SVN: r245268
2017-02-03PR libstdc++/60936 reduce coupling between objects in libstdc++.aJonathan Wakely17-194/+406
Move explicit instantiation definitions for string I/O functions into their own files so that iostream and locale definitions are not needed for uses of strings without I/O. Move functions for throwing C++11 exceptions into the individual files defining the exception types, so that using any of the functions from functexcept.cc doesn't pull in large pieces of the C++11 library. Finally, avoid using __int_to_char in snprintf_lite.cc to avoid pulling in locale-inst.cc for one function. PR libstdc++/60936 * src/c++11/Makefile.am: Add new files. * src/c++11/Makefile.in: Regenerate. * src/c++11/cow-string-inst.cc [!_GLIBCXX_USE_CXX11_ABI] (operator<<, operator>>, getline): Move explicit instantiations to ... * src/c++11/cow-string-io-inst.cc: ... new file. * src/c++11/cow-wstring-inst.cc [!_GLIBCXX_USE_CXX11_ABI] (operator<<, operator>>, getline): Move explicit instantiations to ... * src/c++11/cow-wstring-io-inst.cc: ... new file. * src/c++11/functexcept.cc (__throw_ios_failure, __throw_system_error) (__throw_future_error, __throw_bad_function_call): (__throw_regex_error): Move functions for C++11 exceptions to the files that define the exception types. * src/c++11/functional.cc (__throw_bad_function_call): Move here. * src/c++11/future.cc (__throw_future_error): Likewise. * src/c++11/ios.cc (__throw_ios_failure): Likewise. * src/c++11/regex.cc (__throw_regex_error): Likewise. * src/c++11/snprintf_lite.cc (__concat_size_t): Print decimal representation directly instead of calling __int_to_char. * src/c++11/sso_string.cc (__sso_string): New file for definition of __sso_string type. * src/c++11/string-io-inst.cc [_GLIBCXX_USE_CXX11_ABI]: New file for explicit instantiations of narrow string I/O functions. * src/c++11/system_error.cc (__throw_system_error): Move here. (__sso_string): Move to new file. * src/c++11/wstring-io-inst.cc [_GLIBCXX_USE_CXX11_ABI]: New file for explicit instantiations of wide string I/O functions. * src/c++98/misc-inst.cc [_GLIBCXX_USE_CXX11_ABI] (operator<<) (operator>>, getline): Remove explicit instantiations from here. From-SVN: r245162
2017-01-17re PR other/79046 (g++ -print-file-name=plugin uses full version number in path)Jakub Jelinek4-4/+8
PR other/79046 * configure: Regenerated. config/ * acx.m4 (GCC_BASE_VER): New m4 function. (ACX_TOOL_DIRS): Require GCC_BASE_VER, for --with-gcc-major-version-only use just major number from BASE-VER. gcc/ * configure.ac: Add GCC_BASE_VER. * Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. (CFLAGS-gcc.o): Add -DBASEVER=$(BASEVER_s). (gcc.o): Depend on $(BASEVER). * common.opt (dumpfullversion): New option. * gcc.c (driver_handle_option): Handle OPT_dumpfullversion. * doc/invoke.texi: Document -dumpfullversion. * doc/install.texi: Document --with-gcc-major-version-only. * configure: Regenerated. libatomic/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. libgomp/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. libgcc/ * configure.ac: Add GCC_BASE_VER. * Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. libssp/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. * Makefile.in: Regenerated. liboffloadmic/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * aclocal.m4: Include ../config/acx.m4. * configure: Regenerated. * Makefile.in: Regenerated. libquadmath/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. * Makefile.in: Regenerated. libmpx/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. * Makefile.in: Regenerated. libada/ * configure.ac: Add GCC_BASE_VER. * Makefile.in (version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. lto-plugin/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. * Makefile.in: Regenerated. libitm/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. fixincludes/ * configure.ac: Add GCC_BASE_VER. * Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. libcilkrts/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * aclocal.m4: Include ../config/acx.m4. * configure: Regenerated. * Makefile.in: Regenerated. libcc1/ * configure.ac: Add GCC_BASE_VER. For --with-gcc-major-version-only use just major number from BASE-VER. * configure: Regenerated. * Makefile.in: Regenerated. libobjc/ * configure.ac: Add GCC_BASE_VER. * Makefile.in (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. libstdc++-v3/ * configure.ac: Add GCC_BASE_VER. * fragment.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * po/Makefile.in: Regenerated. * libsupc++/Makefile.in: Regenerated. * testsuite/Makefile.in: Regenerated. * src/Makefile.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. * include/Makefile.in: Regenerated. * doc/Makefile.in: Regenerated. * python/Makefile.in: Regenerated. * src/c++11/Makefile.in: Regenerated. * src/c++98/Makefile.in: Regenerated. * src/filesystem/Makefile.in: Regenerated. libvtv/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * testsuite/Makefile.in: Regenerated. * configure: Regenerated. * Makefile.in: Regenerated. libsanitizer/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * libbacktrace/Makefile.in: Regenerated. * interception/Makefile.in: Regenerated. * asan/Makefile.in: Regenerated. * ubsan/Makefile.in: Regenerated. * configure: Regenerated. * sanitizer_common/Makefile.in: Regenerated. * lsan/Makefile.in: Regenerated. * Makefile.in: Regenerated. * tsan/Makefile.in: Regenerated. libgfortran/ * configure.ac: Add GCC_BASE_VER. * Makefile.am (gcc_version): Use @get_gcc_base_ver@ instead of cat to get version from BASE-VER file. * configure: Regenerated. * Makefile.in: Regenerated. From-SVN: r244521
2017-01-16PR66145 use new ABI for std::ios::failure exceptionsJonathan Wakely1-2/+3
PR libstdc++/66145 * src/c++11/functexcept.cc: Use new ABI for std::ios_base::failure exceptions. * testsuite/27_io/basic_ios/copyfmt/char/1.cc: Don't override ABI for test, so new ios::failure can be caught. * testsuite/27_io/basic_ios/exceptions/char/1.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/char/ exceptions_failbit.cc: Likewise. * testsuite/27_io/basic_istream/extractors_arithmetic/wchar_t/ exceptions_failbit.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/extractors_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_istream/sentry/char/12297.cc: Likewise. * testsuite/27_io/basic_istream/sentry/wchar_t/12297.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/char/ exceptions_null.cc: Likewise. * testsuite/27_io/basic_ostream/inserters_other/wchar_t/ exceptions_null.cc: Likewise. * testsuite/27_io/ios_base/storage/2.cc: Likewise. From-SVN: r244498
2017-01-16PR78702 fix accessibility of locale::facet::__shimJonathan Wakely1-7/+13
PR libstdc++/78702 * include/bits/locale_classes.h (locale::facet::__shim): Change from private to protected. * src/c++11/cxx11-shim_facets.cc (__shim_accessor): Define helper to make locale::facet::__shim accessible. From-SVN: r244491
2017-01-06Build libgo with -Wa,-nH if possible (PR go/78978) [non-libgo parts]Rainer Orth4-8/+12
libstdc++-v3: PR go/78978 * acinclude.m4 (GLIBCXX_CHECK_ASSEMBLER_HWCAP): Remove. * configure.ac: Call GCC_CHECK_ASSEMBLER_HWCAP instead of GLIBCXX_CHECK_ASSEMBLER_HWCAP. * fragment.am (CONFIG_CXXFLAGS): Use HWCAP_CFLAGS instead of HWCAP_FLAGS. * aclocal.m4: Regenerate. * configure: Regenerate. * Makefile.in, doc/Makefile.in, include/Makefile.in, libsupc++/Makefile.in, po/Makefile.in, python/Makefile.in, src/Makefile.in, src/c++11/Makefile.in, src/c++98/Makefile.in, src/filesystem/Makefile.in, testsuite/Makefile.in: Regenerate. config: PR go/78978 * hwcaps.m4 (GCC_CHECK_ASSEMBLER_HWCAP): New macro. From-SVN: r244162
2017-01-04Support exception propagation without lock-free atomic intPauli Nieminen1-2/+1
2017-01-04 Pauli Nieminen <suokkos@gmail.com> Jonathan Wakely <jwakely@redhat.com> PR libstdc++/64735 * acinclude.m4 (GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER): Define. * config.h.in: Regenerate. * config/abi/pre/gnu.ver [HAVE_EXCEPTION_PTR_SINCE_GCC46] (GLIBCXX_3.4.15, GLIBCXX_3.4.21, CXXABI_1.3.3, CXXABI_1.3.5): Make exports for exception_ptr, nested_exception, and future conditional. [HAVE_EXCEPTION_PTR_SINCE_GCC46] (GLIBCXX_3.4.23, CXXABI_1.3.11): Add exports for exception_ptr, nested_exception, and future conditional. * configure: Regenerate. * configure.ac: Use GLIBCXX_CHECK_EXCEPTION_PTR_SYMVER. * include/std/future: Remove check for ATOMIC_INT_LOCK_FREE * libsupc++/eh_atomics.h: New file for internal use only. (__eh_atomic_inc, __eh_atomic_dec): New. * libsupc++/eh_ptr.cc (exception_ptr::_M_addref) (exception_ptr::_M_release) (__gxx_dependent_exception_cleanup) (rethrow_exception): Use eh_atomics.h reference counting helpers. * libsupc++/eh_throw.cc (__gxx_exception_cleanup): Likewise. * libsupc++/eh_tm.cc (free_any_cxa_exception): Likewise. * libsupc++/exception: Remove check for ATOMIC_INT_LOCK_FREE. * libsupc++/exception_ptr.h: Likewise. * libsupc++/guard.cc: Include header for ATOMIC_INT_LOCK_FREE macro. * libsupc++/nested_exception.cc: Remove check for ATOMIC_INT_LOCK_FREE. * libsupc++/nested_exception.h: Likewise. * src/c++11/future.cc: Likewise. * testsuite/18_support/exception_ptr/*: Remove atomic builtins checks. * testsuite/18_support/nested_exception/*: Likewise. * testsuite/30_threads/async/*: Likewise. * testsuite/30_threads/future/*: Likewise. * testsuite/30_threads/headers/future/types_std_c++0x.cc: Likewise. * testsuite/30_threads/packaged_task/*: Likewise. * testsuite/30_threads/promise/*: Likewise. * testsuite/30_threads/shared_future/*: Likewise. Co-Authored-By: Jonathan Wakely <jwakely@redhat.com> From-SVN: r244051
2017-01-01Update copyright years.Jakub Jelinek103-103/+103
From-SVN: r243994
2016-12-06Add #ifdef case for 16 bits in cow-stdexcept.ccFelipe Magno de Almeida1-3/+8
Added #ifdef case for when void* is 16 bits so it compiles in AVR target. 2016-12-06 Felipe Magno de Almeida <felipe@expertisesolutions.com.br> * src/c++11/cow-stdexcept.cc: Add special case for 16 bit pointers. From-SVN: r243310
2016-12-06Add missing noexcept on std::_Sp_locker constructorsAditya Kumar1-2/+2
2016-12-06 Aditya Kumar <hiraditya@msn.com> * src/c++11/shared_ptr.cc (_Sp_locker::_Sp_locker(const void* p)): Add noexcept on constructor. (_Sp_locker::_Sp_locker(const void* p1, const void* p2)): Same. From-SVN: r243291
2016-11-12* src/filesystem/ops.cc (is_empty): Fix typo in exception message.Jonathan Wakely1-1/+1
From-SVN: r242341
2016-11-10debug.cc (format_word): Delete.François Dumont1-61/+58
2016-11-10 François Dumont <fdumont@gcc.gnu.org> * src/c++11/debug.cc (format_word): Delete. (print_literal): New. Replace call to print_word for literals. From-SVN: r242055
2016-10-27PR70975 Pass valid offset argument to sendfileUros Bizjak1-1/+2
PR libstdc++/70975 * src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]: Pass non-null pointer to sendfile for offset argument. From-SVN: r241629
2016-10-26Add recursive_directory_iterator::pop(error_code&)Jonathan Wakely1-5/+19
* include/experimental/bits/fs_dir.h (recursive_directory_iterator): Overload pop (LWG 2706). * src/filesystem/dir.cc (recursive_directory_iterator::pop): Define new overload. * testsuite/experimental/filesystem/iterators/pop.cc: New test. From-SVN: r241559
2016-10-26Fix error handling in recursive_directory_iterator::incrementJonathan Wakely1-1/+4
* src/filesystem/dir.cc (recursive_directory_iterator::increment): Reset state on error. * testsuite/experimental/filesystem/iterators/ recursive_directory_iterator.cc: Check state after increment error. From-SVN: r241552
2016-10-26PR78111 fix fallback code for filesystem::canonicalJonathan Wakely1-1/+5
PR libstdc++/78111 * src/filesystem/ops.cc (canonical): Set error for non-existent path. From-SVN: r241549
2016-10-25Handle negative times in filesystem::last_write_timeJonathan Wakely1-0/+5
* src/filesystem/ops.cc (last_write_time(const path&, file_time_type, error_code&)): Handle negative times correctly. * testsuite/experimental/filesystem/operations/last_write_time.cc: Test writing file times. From-SVN: r241522
2016-10-25Fix error handling in copy_file and equivalentJonathan Wakely1-12/+36
* src/filesystem/ops.cc (do_copy_file): Report an error if source or destination is not a regular file (LWG 2712). (equivalent): Fix error handling and result when only one file exists. * testsuite/experimental/filesystem/operations/copy.cc: Remove files created by tests. Test copying directories. * testsuite/experimental/filesystem/operations/copy_file.cc: Remove files created by tests. * testsuite/experimental/filesystem/operations/equivalent.cc: New. * testsuite/experimental/filesystem/operations/is_empty.cc: New. * testsuite/experimental/filesystem/operations/read_symlink.cc: Remove file created by test. * testsuite/experimental/filesystem/operations/remove_all.cc: New. * testsuite/util/testsuite_fs.h (~scoped_file): Only try to remove file if path is non-empty, to support removal by other means. From-SVN: r241521
2016-10-24Fix error handling in filesystem::is_emptyJonathan Wakely1-5/+9
* src/filesystem/ops.cc (is_empty): Fix error handling. * testsuite/experimental/filesystem/operations/is_empty.cc: New test. From-SVN: r241488
2016-10-24PR71337 fix filesystem::temp_directory_path error handlingJonathan Wakely1-4/+9
PR libstdc++/71337 * src/filesystem/ops.cc (temp_directory_path): Pass error_code argument to other filesystem operations. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: Add testcase for inaccessible directory. From-SVN: r241487
2016-10-24Make directory iterators become end iterator on errorJonathan Wakely1-14/+3
* src/filesystem/dir.cc (open_dir): Return same value for errors whether ignored or not. (_Dir::advance(error_code*, directory_options)): Return false on error. (directory_iterator(const path&, directory_options, error_code*)): Create end iterator on error (LWG 2723). (recursive_directory_iterator(const path&, directory_options, error_code*)): Likewise. * testsuite/experimental/filesystem/iterators/directory_iterator.cc: Update expected behaviour on error. * testsuite/experimental/filesystem/iterators/ recursive_directory_iterator.cc: Likewise. From-SVN: r241486
2016-10-24Do not retry failed close(3) in filesystem::copyJonathan Wakely1-13/+2
* src/filesystem/ops.cc (close_fd): Remove. (do_copy_file): Just use close(3) instead of close_fd, to prevent retrying on error. From-SVN: r241485
2016-10-24Implement DR resolutions for filesystem::copyJonathan Wakely1-2/+21
* src/filesystem/ops.cc (do_copy_file): Return an error if either source or destination is not a regular file. (copy): Update comment to refer to LWG 2681. Implement 2682 and 2683 resolutions. (read_symlink): Add missing ec.clear(). * testsuite/experimental/filesystem/operations/copy.cc: Update expected behaviour for copying directories with create_symlinks. Verify that error_code arguments are cleared if there's no error. * testsuite/experimental/filesystem/operations/read_symlink.cc: New. From-SVN: r241484
2016-10-22Ignore perms::symlink_nofollow on non-symlinksJonathan Wakely1-7/+14
* src/filesystem/ops.cc (permissions(const path&, perms, error_code&)): Ignore symlink_nofollow flag if file is not a symlink. * testsuite/experimental/filesystem/operations/permissions.cc: Test symlink_nofollow on non-symlinks. From-SVN: r241438
2016-10-21LWG2720 implement filesystem::perms::symlink_nofollowJonathan Wakely1-3/+7
* include/experimental/bits/fs_fwd.h (perms::resolve_symlinks): Replace with symlink_nofollow (LWG 2720). * src/filesystem/ops.cc (permissions(const path&, perms, error_code&)): Handle symlink_nofollow. * testsuite/experimental/filesystem/operations/create_symlink.cc: New test. * testsuite/experimental/filesystem/operations/permissions.cc: Test overload taking error_code. From-SVN: r241418
2016-10-21LWG2725 Fix error reporting for filesystem::existsJonathan Wakely1-1/+5
* include/experimental/bits/fs_ops.h (exists(const path&, error_code&)): Clear error if status is known (LWG 2725). (status(const path&, error_code&)): Handle EOVERFLOW. * testsuite/experimental/filesystem/operations/exists.cc: Test overload taking an error_code. From-SVN: r241417
2016-10-21Split <functional> into smaller piecesJonathan Wakely1-0/+1
* include/Makefile.am: Add <bits/refwrap.h> and <bits/std_function.h>. Order alphabetically. * include/Makefile.in: Regenerate. * include/bits/refwrap.h: New header. (_Maybe_get_result_type,_Weak_result_type_impl, _Weak_result_type) (_Reference_wrapper_base_impl, _Reference_wrapper_base) (reference_wrapper, ref, cref): Move here from <functional>. * include/bits/shared_ptr_base.h: Include <bits/refwrap.h> and <bits/stl_function.h> instead of <functional>. * include/bits/std_function.h: New header. (_Maybe_unary_or_binary_function, bad_function_call) (__is_location_invariant, _Nocopy_types, _Any_data) (_Simple_type_wrapper, _Function_base, _Function_handler, function): Move here from <functional>. * include/bits/unique_ptr.h: Include <bits/stl_function.h>. * include/std/functional: Include new headers and move components to them. * include/std/future: Include <bits/std_function.h> instead of <functional>. * include/std/mutex: Likewise. * include/std/regex: Likewise. * src/c++11/compatibility-thread-c++0x.cc: Include <functional>. * testsuite/20_util/default_delete/48631_neg.cc: Adjust dg-error line. * testsuite/20_util/default_delete/void_neg.cc: Likewise. * testsuite/20_util/unique_ptr/assign/48635_neg.cc: Adjust dg-error lines. * testsuite/20_util/unique_ptr/cons/cv_qual_neg.cc: Likewise. * testsuite/30_threads/packaged_task/49668.cc: Include <functional>. From-SVN: r241410
2016-10-14Make std::bind use std::invokeJonathan Wakely1-0/+13
* include/std/functional (_Mu<A, false, true>, _Mu<A, true, false>): Simplify forwarding from tuple of references. (_Maybe_wrap_member_pointer): Remove. (_Bind::__call, _Bind::__call_c, _Bind::__call_v, _Bind::__call_c_v): Use std::__invoke. (_Bind::_Mu_type, _Bind::_Res_type_impl, _Bind::_Res_type) (_Bind::__dependent, _Bind::_Res_type_cv): New helpers to simplify return type deduction. (_Bind::operator(), _Bind::operator() const): Use new helpers. (_Bind::operator() volatile, _Bind::operator() const volatile): Likewise. Add deprecated attribute for C++17 mode. (_Bind_result::__call): Use std::__invoke. (_Bind_result::operator() volatile) (_Bind_result::operator() const volatile): Add deprecated attribute. (_Bind_helper::__maybe_type, _Bindres_helper::__maybe_type): Remove. (_Bind_helper, _Bindres_helper): Don't use _Maybe_wrap_member_pointer. (bind, bind<R>): Don't use __maybe_type. * src/c++11/compatibility-thread-c++0x.cc (_Maybe_wrap_member_pointer): Define here for compatibility symbols. * testsuite/20_util/bind/68912.cc: Don't test volatile-qualification in C++17 mode. * testsuite/20_util/bind/cv_quals.cc: Likewise. * testsuite/20_util/bind/cv_quals_2.cc: Likewise. From-SVN: r241178
2016-10-13Restore __bind_simple for compat symbolsJonathan Wakely1-0/+62
* src/c++11/compatibility-thread-c++0x.cc (_Bind_simple) (_Bind_simple_helper, __bind_simple): Restore for ABI compat symbols. From-SVN: r241111
2016-10-03shared_ptr.cc (mask, [...]): Move declaration...François Dumont3-29/+65
2016-10-03 François Dumont <fdumont@gcc.gnu.org> * src/c++11/shared_ptr.cc (mask, invalid, get_mutex): Move declaration... * src/c++11/mutex_pool.h: ... here. New. * src/c++11/debug.cc: Use latter. From-SVN: r240732
2016-09-29Disable .gnu.attributes tags in compatibility-ldbl.oAlan Modra5-4/+8
compatibility-ldbl.o is compiled with -mlong-double-64. When long double .gnu.attributes tags are checked by the linker, it complains about the mismatch between this file and others in libstdc++. * configure.ac (LONG_DOUBLE_COMPAT_FLAGS): New ACSUBST. * src/Makefile.am (compatibility-ldbl.o, compatibility-ldbl.lo): Use LONG_DOUBLE_COMPAT_FLAGS. * Makefile.in: Regenerate. * configure: Regenerate. * doc/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * libsupc++/Makefile.in: Regenerate. * po/Makefile.in: Regenerate. * python/Makefile.in: Regenerate. * src/Makefile.in: Regenerate. * src/c++11/Makefile.in: Regenerate. * src/c++98/Makefile.in: Regenerate. * src/filesystem/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. From-SVN: r240602
2016-09-28Check for overflow in filesystem::last_write_timeJonathan Wakely1-11/+19
* include/experimental/bits/fs_fwd.h (file_time_type): Simplify definition. * src/filesystem/ops.cc (file_time): Take error_code parameter and check for overflow. (do_copy_file, last_write_time): Pass error_code in file_time calls. * testsuite/experimental/filesystem/operations/last_write_time.cc: New. * testsuite/util/testsuite_fs.h (scoped_file): Define RAII helper. From-SVN: r240587
2016-09-25debug.cc: Include debug/vector.François Dumont1-47/+58
2016-09-25 François Dumont <fdumont@gcc.gnu.org> * src/c++11/debug.cc: Include debug/vector. Include cctype. Remove functional. (get_safe_base_mutex): Get mutex based on address lowest non nil bits. * testsuite/23_containers/vector/debug/mutex_association.cc: New. From-SVN: r240479
2016-08-15ops.cc: Always include ostream and ext/stdio_filebuf.h.Uros Bizjak1-22/+29
* src/filesystem/ops.cc: Always include ostream and ext/stdio_filebuf.h. (do_copy_file): Check if _GLIBCXX_USE_FCHMODAT is defined. [_GLIBCXX_USE_SENDFILE]: Fallback to read/write operations in case sendfile fails with ENOSYS or EINVAL. From-SVN: r239479
2016-07-04re PR libstdc++/71313 ([Filesystem TS] remove_all fails to remove directory ↵Ville Voutilainen1-1/+1
contents recursively) PR libstdc++/71313 * src/filesystem/ops.cc (remove_all(const path&, error_code&)): Call remove_all for children of a directory. * testsuite/experimental/filesystem/operations/create_directories.cc: Adjust. From-SVN: r237978