aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src
AgeCommit message (Collapse)AuthorFilesLines
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
2016-06-20re PR libstdc++/71181 (Reserving in unordered_map doesn't reserve enough)François Dumont2-6/+23
2016-06-20 François Dumont <fdumont@gcc.gnu.org> PR libstdc++/71181 * include/tr1/hashtable_policy.h (_Prime_rehash_policy::_M_next_bkt): Make past-the-end iterator dereferenceable to avoid check on lower_bound result. (_Prime_rehash_policy::_M_bkt_for_elements): Call latter. (_Prime_rehash_policy::_M_need_rehash): Likewise. * src/c++11/hashtable_c++0x.cc (_Prime_rehash_policy::_M_next_bkt): Always return a value greater than input value. Set _M_next_resize to max value when reaching highest prime number. * src/shared/hashtable-aux.cc (__prime_list): Add comment about sentinel being now useless. * testsuite/23_containers/unordered_set/hash_policy/71181.cc: New. * testsuite/23_containers/unordered_set/hash_policy/power2_rehash.cc (test02): New. * testsuite/23_containers/unordered_set/hash_policy/prime_rehash.cc: New. * testsuite/23_containers/unordered_set/hash_policy/rehash.cc: Fix indentation. From-SVN: r237617
2016-06-06libstdc++/71320 Add or remove file permissions correctlyJonathan Wakely1-0/+22
PR libstdc++/71320 * src/filesystem/ops.cc (permissions(const path&, perms, error_code&)): Add or remove permissions according to perms argument. * testsuite/experimental/filesystem/operations/permissions.cc: New test. From-SVN: r237136
2016-05-11libstdc++/71049 fix --disable-libstdcxx-dual-abi bootstrapJonathan Wakely1-17/+20
PR libstdc++/71049 * src/c++11/cow-stdexcept.cc [!_GLIBCXX_USE_DUAL_ABI]: Don't define exception constructors with __sso_string parameters. From-SVN: r236118
2016-05-10libstdc++/71038 fix error checks in filesystem::copy_fileJonathan Wakely1-1/+1
PR libstdc++/71038 * src/filesystem/ops.cc (do_copy_file): Fix backwards conditions. * testsuite/experimental/filesystem/operations/copy_file.cc: New test. From-SVN: r236084
2016-05-10libstdc++/71036 Handle EEXIST in filesystem::create_directoryJonathan Wakely1-4/+8
PR libstdc++/71036 * src/filesystem/ops.cc (create_dir): Handle EEXIST from mkdir. * testsuite/experimental/filesystem/operations/create_directory.cc: New test. From-SVN: r236076
2016-05-10libstdc++/71037 Add base path to filesystem::canonical exceptionsJonathan Wakely1-2/+3
PR libstdc++/71037 * src/filesystem/ops.cc (canonical(const path&, const path&)): Add base path to exception. * testsuite/experimental/filesystem/operations/canonical.cc: Test paths contained in exception. From-SVN: r236074
2016-04-29Remove trailing whitespace from libstdc++-v3 filesChris Gregory49-491/+491
2016-04-29 Chris Gregory <czipperz@gmail.com> * config/*: Remove trailing whitespace. * src/*: Likewise. * testsuite/tr1/*: Likewise. * testsuite/util/*: Likewise. From-SVN: r235645
2016-04-20Fix std::codecvt_utf8* for big-endian targetsJonathan Wakely1-2/+2
PR libstdc++/69703 * src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in, __codecvt_utf8_utf16_base<char16_t>::do_in): Fix mask operations. From-SVN: r235293
2016-04-19libstdc++/69703 ignore endianness in codecvt_utf8Jonathan Wakely1-1/+5
PR libstdc++/69703 * src/c++11/codecvt.cc (__codecvt_utf8_base<char16_t>::do_in)): Override endianness bit in mode. * testsuite/22_locale/codecvt/codecvt_utf8/69703.cc: New test. * testsuite/22_locale/codecvt/codecvt_utf8_utf16/66855.cc: Test that little_endian mode is ignored. * testsuite/experimental/filesystem/path/native/string.cc: New test. From-SVN: r235216
2016-04-19libstdc++/70609 fix filesystem::copy()Jonathan Wakely1-17/+46
PR libstdc++/70609 * src/filesystem/ops.cc (close_fd): New function. (do_copy_file): Set permissions before copying file contents. Check result of closing file descriptors. Don't copy streambuf when file is empty. (copy(const path&, const path&, copy_options, error_code&)): Use lstat for source file when copy_symlinks is set. * testsuite/experimental/filesystem/operations/copy.cc: Test copy(). From-SVN: r235215
2016-04-19Add noexcept to Filesystem TS operatorsJonathan Wakely1-4/+4
* include/experimental/bits/fs_fwd.h (operator&, operator|, operator^, operator~ operator&=, operator|=, operator^=): Add noexcept to overloaded operators for copy_options, perms and directory_options. * src/filesystem/ops.cc (make_file_type, make_file_status, is_not_found_errno, file_time): Add noexcept. From-SVN: r235214
2016-04-06Makefile.am (libstdc++-symbols.ver): Remove useless /dev/null.Eric Botcazou2-2/+2
* src/Makefile.am (libstdc++-symbols.ver): Remove useless /dev/null. * src/Makefile.in: Regenerate. From-SVN: r234782
2016-04-05Ensure std::thread helpers have internal linkageJonathan Wakely1-4/+4
PR libstdc++/70503 * src/c++11/thread.cc (execute_native_thread_routine, execute_native_thread_routine_compat): Give internal linkage. * testsuite/30_threads/thread/70503.cc: New test. From-SVN: r234746
2016-01-18libstdc++: Fix usage of __GXX_WEAK__ in TM TS support.Torvald Riegel1-14/+9
* include/bits/c++config (_GLIBCXX_USE_WEAK_REF): New. (_GLIBCXX_TXN_SAFE, _GLIBCXX_TXN_SAFE_DYN): Use _GLIBCXX_USE_WEAK_REF and move after its definition. * config/os/aix/os_defines.h (_GLIBCXX_USE_WEAK_REF): Override. * src/c++11/cow-stdexcept.cc: Use _GLIBCXX_USE_WEAK_REF instead of __GXX_WEAK__, and only provide transactional clones if _GLIBCXX_USE_WEAK_REF is true. Don't provide stubs of libitm functions. From-SVN: r232539
2016-01-18Fix libstdc++ build with -fno-exceptionsJonathan Wakely1-4/+5
PR libstdc++/69340 * src/c++11/cow-stdexcept.cc (_txnal_cow_string_C1_for_exceptions): Use macros for exception handling and fix unused parameter warning. From-SVN: r232502
2016-01-17libstdc++: Fix static_assert.Torvald Riegel1-2/+2
* src/c++11/cow-stdexcept.cc (txnal_read_ptr): Fix static_assert. From-SVN: r232483
2016-01-15libstdc++: Make certain exceptions transaction_safe.Torvald Riegel1-0/+289
From-SVN: r232454
2016-01-04Update copyright years.Jakub Jelinek102-102/+102
From-SVN: r232055
2015-12-18Fix a regression introduced by the fix of libstdc++/68276.Ville Voutilainen1-1/+7
2015-12-18 Ville Voutilainen <ville.voutilainen@gmail.com> Fix a regression introduced by the fix of libstdc++/68276. * src/c++11/ios.cc (_M_grow_words): Catch bad_alloc again so that bad_array_new_length is handled properly. From-SVN: r231839
2015-12-18re PR libstdc++/68276 (ios_base::_M_grow_words should use new (std::nothrow))Ville Voutilainen1-3/+2
2015-12-18 Ville Voutilainen <ville.voutilainen@gmail.com> PR libstdc++/68276 * src/c++11/ios.cc (_M_grow_words): Use nothrow new. * testsuite/27_io/ios_base/storage/11584.cc: Adjust. From-SVN: r231819
2015-12-16libstdc++/68921 add timeout argument to futex(2)Jonathan Wakely1-1/+1
PR libstdc++/68921 * src/c++11/futex.cc (__atomic_futex_unsigned_base::_M_futex_wait_until): Use null pointer as timeout argument. From-SVN: r231676
2015-11-13More fine-grained autoconf checks for C99 libraryJennifer Yao1-2/+2
2015-11-13 Jennifer Yao <jenny.hyphen.fa@gmail.com> Jonathan Wakely <jwakely@redhat.com> PR libstdc++/58393 PR libstdc++/61580 * acinclude.m4 (GLIBCXX_ENABLE_C99): Perform tests twice, with -std=c++11 as well as -std=c++98, and define separate macros for each. Cache the results of checking for complex math and wide character functions. Reformat for readability. * config.h.in: Regenerate. * include/bits/c++config: Define _GLIBCXX_USE_C99_XXX macros to either _GLIBCXX98_USE_C99_XXX or _GLIBCXX11_USE_C99_XXX according to language standard in use. * config/locale/dragonfly/c_locale.h (std::__convert_from_v): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. * config/locale/generic/c_locale.h (std::__convert_from_v): Likewise. * config/locale/gnu/c_locale.h (std::__convert_from_v): Likewise. * config/os/bsd/dragonfly/os_defines.h: Define _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and _GLIBCXX_USE_C99_WCHAR. * configure: Regenerate. * include/bits/basic_string.h: Make numeric conversion functions depend on _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, or _GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99. * include/ext/vstring.h: Likewise. * include/bits/locale_facets.tcc (std::num_put::_M_insert_float): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. * include/bits/locale_facets_nonio.tcc (std::money_put::do_put): Likewise. * include/c_compatibility/math.h: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_MATH. * include/c_compatibility/wchar.h: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR. * include/c_global/cstdio: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. * include/c_global/cstdlib: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB. * include/c_global/cwchar: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR. * include/c_std/cstdio: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. * include/c_std/cstdlib: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB. * include/c_std/cwchar: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR. * include/tr1/cstdio: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. * include/tr1/cstdlib: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB. * include/tr1/cwchar: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR. * include/tr1/stdlib.h: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB. * src/c++98/locale_facets.cc (std::__num_base::_S_format_float): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. * testsuite/18_support/exception_ptr/60612-terminate.cc: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB. * testsuite/18_support/exception_ptr/60612-unexpected.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/stod.cc (test01): Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ stof.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ stoi.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ stol.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ stold.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ stoll.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ stoul.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ stoull.cc: Likewise. * testsuite/21_strings/basic_string/numeric_conversions/wchar_t/ to_wstring.cc: Likewise. * testsuite/26_numerics/headers/cstdlib/13943.cc: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB. * testsuite/26_numerics/headers/cstdlib/types_std_c++0x.cc: Likewise. * testsuite/lib/libstdc++.exp (check_v3_target_string_conversions): Change preprocessor #if conditional so that it uses _GLIBCXX_USE_C99_STDIO, _GLIBCXX_USE_C99_STDLIB, and _GLIBCXX_USE_C99_WCHAR, instead of _GLIBCXX_USE_C99. * testsuite/tr1/8_c_compatibility/cmath/templates.cc: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_MATH. * testsuite/tr1/8_c_compatibility/cstdio/functions.cc: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. * testsuite/tr1/8_c_compatibility/cstdlib/functions.cc: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDLIB. * testsuite/tr1/8_c_compatibility/cstdlib/types_std_tr1.cc: Likewise. * testsuite/tr1/8_c_compatibility/cwchar/functions.cc: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_WCHAR. * testsuite/util/testsuite_fs.h: Replace _GLIBCXX_USE_C99 with _GLIBCXX_USE_C99_STDIO. Co-Authored-By: Jonathan Wakely <jwakely@redhat.com> From-SVN: r230324
2015-11-11Loop in std::this_thread sleep functionsJonathan Wakely1-1/+2
PR libstdc++/60421 * include/std/thread (this_thread::sleep_for): Retry on EINTR. (this_thread::sleep_until): Retry if time not reached. * src/c++11/thread.cc (__sleep_for): Retry on EINTR. * testsuite/30_threads/this_thread/60421.cc: Test interruption and non-steady clocks. From-SVN: r230183
2015-10-03Fix comments saying why headers are includedJonathan Wakely2-2/+1
* src/c++98/locale.cc: Fix comment. * src/c++98/locale_init.cc: Likewise. From-SVN: r228446
2015-10-03Enable dual ABI for Filesystem libraryJonathan Wakely8-4/+113
* src/filesystem/Makefile.am: Add cxx11_abi_sources. * src/filesystem/Makefile.in: Regenerate. * src/filesystem/cow-dir.cc: New. * src/filesystem/cow-ops.cc: New. * src/filesystem/cow-path.cc: New. * src/filesystem/dir.cc: Define macro for new ABI. * src/filesystem/ops.cc: Likewise. * src/filesystem/path.cc: Likewise. From-SVN: r228437
2015-10-02Allow Filesystem TS to compile without wchar_tJonathan Wakely1-1/+5
* include/bits/locale_conv.h [!_GLIBCXX_USE_WCHAR_T] (__do_str_codecvt, __str_codecvt_in, __str_codecvt_out): Enable. * include/experimental/fs_path.h [!_GLIBCXX_USE_WCHAR_T] (path::wstring, path::generic_wstring): Disable. * src/filesystem/path.cc (path::_S_convert_loc) [!_GLIBCXX_USE_WCHAR_T]: Skip conversion. * testsuite/experimental/filesystem/path/assign/assign.cc: Check for wchar_t support. * testsuite/experimental/filesystem/path/concat/strings.cc: Likewise. * testsuite/experimental/filesystem/path/construct/range.cc: Likewise. From-SVN: r228417
2015-10-02PR libstdc++/67747 use readdir instead of readdir_rJonathan Wakely1-32/+25
PR libstdc++/67747 * src/filesystem/dir.cc (native_readdir): Remove. (_Dir::advance): Use readdir instead of native_readdir. (recursive_directory_iterator(const path&, directory_options, error_code*)): Use swap instead of reset. From-SVN: r228404
2015-09-30messages_members.cc (Catalog_info, Catalogs): Move...François Dumont2-0/+12
2015-09-30 François Dumont <fdumont@gcc.gnu.org> Jonathan Wakely <jwakely@redhat.com> * config/locale/gnu/messages_members.cc (Catalog_info, Catalogs): Move... * config/locale/gnu/c++locale_internal.h: ...here in std namespace. * config/locale/gnu/c_locale.cc: Move implementation of latter here. * src/c++98/Makefile.am: Compile c++locale.cc with -fimplicit-templates. * src/c++98/Makefile.in: Regenerate. * config/abi/pre/gnu.ver: Adjust. Co-Authored-By: Jonathan Wakely <jwakely@redhat.com> From-SVN: r228305
2015-09-29Reduce space and time overhead of std::threadJonathan Wakely1-2/+45
PR libstdc++/65393 * config/abi/pre/gnu.ver: Export new symbols. * include/std/thread (thread::_State, thread::_State_impl): New types. (thread::_M_start_thread): Add overload taking unique_ptr<_State>. (thread::_M_make_routine): Remove. (thread::_S_make_state): Add. (thread::_Impl_base, thread::_Impl, thread::_M_start_thread) [_GLIBCXX_THREAD_ABI_COMPAT] Only declare conditionally. * src/c++11/thread.cc (execute_native_thread_routine): Rename to execute_native_thread_routine_compat and re-define to use _State. (thread::_State::~_State()): Define. (thread::_M_make_thread): Define new overload. (thread::_M_make_thread) [_GLIBCXX_THREAD_ABI_COMPAT]: Only define old overloads conditionally. From-SVN: r228242
2015-09-28LWG 2135: terminate() in condition_variable::wait()Jonathan Wakely1-2/+2
* include/std/condition_variable (condition_variable::wait): Add noexcept. * src/c++11/condition_variable.cc (condition_variable::wait): Call std::terminate on error (DR 2135). From-SVN: r228217
2015-09-23Limit number of symlinks that canonical() will resolveJonathan Wakely1-33/+27
* src/filesystem/ops.cc (canonical): Simplify error handling and limit number of symlinks that can be resolved. From-SVN: r228043
2015-09-23Fix semantics of Filesystem TS directory iteratorsJonathan Wakely1-59/+49
[class.directory_iterator] p4 and [directory_iterator.members] p4 require that only the default constructor and ignored permission denied errors can create the end iterator. * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Remove _GLIBCXX_ prefix from HAVE_STRUCT_DIRENT_D_TYPE. * config.h.in: Regenerate. * configure: Regenerate. * include/experimental/fs_dir.h (operator==, operator==): Use owner_before instead of pointer equality. (directory_iterator(std::shared_ptr<_Dir>, error_code*)): Remove. * src/filesystem/dir.cc (ErrorCode): Remove. (_Dir::advance): Change ErrorCode parameter to error_code*, add directory_options parameter and check it on error. (opendir): Rename to open_dir to avoid clashing with macro. Change ErrorCode parameter to error_code*. (make_shared_dir): Remove. (native_readdir) [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Don't set errno. (directory_iterator(std::shared_ptr<_Dir>, error_code*)): Remove. (directory_iterator(const path&, directory_options, error_code*)): Pass options to _Dir::advance and create non-end iterator on error. (recursive_directory_iterator(const path&, directory_options, error_code*)): Clear error_code on ignored error, create non-end iterator otherwise. (recursive_directory_iterator::increment): Pass _M_options to _Dir::advance. (recursive_directory_iterator::pop): Likewise. * testsuite/experimental/filesystem/iterators/directory_iterator.cc: New. * testsuite/experimental/filesystem/iterators/ recursive_directory_iterator.cc: New. From-SVN: r228042
2015-09-23Fix filesystem::create_directories() functionJonathan Wakely1-6/+41
* src/filesystem/ops.cc (is_dot, is_dotdot): Define new helpers. (create_directories): Fix error handling. * testsuite/experimental/filesystem/operations/create_directories.cc: New. From-SVN: r228041
2015-09-17debug.cc: Include <cstdio>.Catherine Moore1-0/+1
2015-09-17 Catherine Moore <clm@codesourcery.com> * src/c++11/debug.cc: Include <cstdio>. From-SVN: r227888
2015-09-17Include <cerrno> in src/c++11/random.ccGerald Pfeifer1-0/+1
2015-09-17 Gerald Pfeifer <gerald@pfeifer.com> * src/c++11/random.cc: Include <cerrno>. From-SVN: r227887
2015-09-172015-09-17 François Dumont <fdumont@gcc.gnu.org>François Dumont1-386/+448
* include/debug/formatter.h (_Error_formatter::_Parameter::_M_print_field): Deprecate. (_Error_formatter::_Parameter::_M_print_description): Likewise. (_Error_formatter::_M_format_word): Likewise. (_Error_formatter::_M_print_word): Likewise. (_Error_formatter::_M_print_string): Likewise. (_Error_formatter::_M_get_max_length): Likewise. (_Error_formatter::_M_max_length): Delete. (_Error_formatter::_M_indent): Likewise. (_Error_formatter::_M_column): Likewise. (_Error_formatter::_M_first_line): Likewise. (_Error_formatter::_M_wordwrap): Likewise. * src/c++11/debug.cc: Adapt. From-SVN: r227885
2015-09-17Make std::random_device retry after short readsJonathan Wakely1-7/+17
PR libstdc++/65142 * src/c++11/random.cc (random_device::_M_getval()): Retry after short reads. From-SVN: r227872
2015-09-16Implement filesystem::canonical() without realpathJonathan Wakely1-12/+87
PR libstdc++/67173 * acinclude.m4 (GLIBCXX_CHECK_FILESYSTEM_DEPS): Check _XOPEN_VERSION and PATH_MAX for _GLIBCXX_USE_REALPATH. * config.h.in: Regenerate. * configure: Regenerate. * src/filesystem/ops.cc: (canonical) [!_GLIBCXX_USE_REALPATH]: Add alternative implementation. * testsuite/experimental/filesystem/operations/canonical.cc: New. * testsuite/experimental/filesystem/operations/exists.cc: Add more tests. * testsuite/experimental/filesystem/operations/absolute.cc: Add test variables. * testsuite/experimental/filesystem/operations/copy.cc: Likewise. * testsuite/experimental/filesystem/operations/current_path.cc: Likewise. * testsuite/experimental/filesystem/operations/file_size.cc: Likewise. * testsuite/experimental/filesystem/operations/status.cc: Likewise. * testsuite/experimental/filesystem/operations/temp_directory_path.cc: Likewise. From-SVN: r227836
2015-09-11Fix filesystem::canonical on Solaris 10.Jonathan Wakely1-1/+6
PR libstdc++/67173 * src/filesystem/ops.cc (filesystem::canonical): Allocate buffer for realpath on Solaris 10. From-SVN: r227689
2015-09-11Check read() result in std::random_device.Jonathan Wakely1-4/+8
PR libstdc++/65142 * src/c++11/random.cc (random_device::_M_getval()): Check read result. From-SVN: r227687