Index: libgomp/ChangeLog =================================================================== --- libgomp/ChangeLog (.../tags/gcc_6_4_0_release) +++ libgomp/ChangeLog (.../branches/gcc-6-branch) @@ -1,3 +1,31 @@ +2017-12-10 Tom de Vries + + backport from trunk: + PR c/81875 + 2017-09-16 Tom de Vries + + * testsuite/libgomp.c/pr81875.c: New test. + +2017-09-15 Jakub Jelinek + + Backported from mainline + 2017-09-14 Jakub Jelinek + + PR c++/81314 + * testsuite/libgomp.c++/pr81314.C: New test. + + 2017-08-09 Jakub Jelinek + + PR c/81687 + * testsuite/libgomp.c/pr81687-1.c: New test. + * testsuite/libgomp.c/pr81687-2.c: New test. + + 2017-07-27 Jakub Jelinek + + PR c/45784 + * testsuite/libgomp.c/pr45784.c: New test. + * testsuite/libgomp.c++/pr45784.C: New test. + 2017-07-04 Release Manager * GCC 6.4.0 released. Index: libgomp/testsuite/libgomp.c++/pr81314.C =================================================================== --- libgomp/testsuite/libgomp.c++/pr81314.C (.../tags/gcc_6_4_0_release) (nonexistent) +++ libgomp/testsuite/libgomp.c++/pr81314.C (.../branches/gcc-6-branch) @@ -0,0 +1,38 @@ +// PR c++/81314 +// { dg-do link } + +template +struct S { + S () { s = 0; } + S (const S &x) { s = x.s; } + ~S () {} + int s; +}; + +void +foo (S<2> &x) +{ + #pragma omp taskloop + for (int i = 0; i < 100; ++i) + x.s++; +} + +void +bar (S<3> &x) +{ + #pragma omp task + x.s++; +} + +int +main () +{ + S<2> s; + S<3> t; + #pragma omp parallel + #pragma omp master + { + foo (s); + bar (t); + } +} Index: libgomp/testsuite/libgomp.c++/pr45784.C =================================================================== --- libgomp/testsuite/libgomp.c++/pr45784.C (.../tags/gcc_6_4_0_release) (nonexistent) +++ libgomp/testsuite/libgomp.c++/pr45784.C (.../branches/gcc-6-branch) @@ -0,0 +1,5 @@ +// PR c/45784 +// { dg-do run } + +#include "../libgomp.c/pr45784.c" + Index: libgomp/testsuite/libgomp.c/pr81687-2.c =================================================================== --- libgomp/testsuite/libgomp.c/pr81687-2.c (.../tags/gcc_6_4_0_release) (nonexistent) +++ libgomp/testsuite/libgomp.c/pr81687-2.c (.../branches/gcc-6-branch) @@ -0,0 +1,27 @@ +/* PR c/81687 */ +/* { dg-do link } */ +/* { dg-additional-options "-O2" } */ + +int +main () +{ + __label__ lab4, lab5, lab6; + volatile int l = 0; + int m = l; + void foo (int x) { if (x == 1) goto lab4; } + void bar (int x) { if (x == 2) goto lab5; } + void baz (int x) { if (x == 3) goto lab6; } + #pragma omp parallel + { + foo (m + 1); + lab4:; + } + #pragma omp task + { + bar (m + 2); + lab5:; + } + baz (m + 3); + lab6:; + return 0; +} Index: libgomp/testsuite/libgomp.c/pr81875.c =================================================================== --- libgomp/testsuite/libgomp.c/pr81875.c (.../tags/gcc_6_4_0_release) (nonexistent) +++ libgomp/testsuite/libgomp.c/pr81875.c (.../branches/gcc-6-branch) @@ -0,0 +1,46 @@ +/* { dg-do run } */ + +extern +#ifdef __cplusplus +"C" +#endif +void abort (void); + +#define N 32ULL +int a[N]; + +const unsigned long long c = 0x7fffffffffffffffULL; + +void +f2_tpf_static32 (void) +{ + unsigned long long i; + #pragma omp for + for (i = c + N; i > c; i -= 1ULL) + a[i - 1ULL - c] -= 4; +} + +__attribute__((noinline, noclone)) int +test_tpf_static32 (void) +{ + int i, j, k; + for (i = 0; i < N; i++) + a[i] = i - 25; + + f2_tpf_static32 (); + + for (i = 0; i < N; i++) + if (a[i] != i - 29) + return 1; + + return 0; +} + +int +main () +{ + if (test_tpf_static32 ()) + abort (); + + return 0; +} Index: libgomp/testsuite/libgomp.c/pr45784.c =================================================================== --- libgomp/testsuite/libgomp.c/pr45784.c (.../tags/gcc_6_4_0_release) (nonexistent) +++ libgomp/testsuite/libgomp.c/pr45784.c (.../branches/gcc-6-branch) @@ -0,0 +1,41 @@ +/* PR c/45784 */ +/* { dg-do run } */ + +void +foo (int n) +{ + char *p, vla[2 * n]; + int i; + #pragma omp parallel for + for (p = vla; p < vla + (sizeof (vla) / sizeof (vla[0])); p++) + *p = ' '; + #pragma omp parallel for + for (i = 0; i < 2 * n; i++) + if (vla[i] != ' ') + __builtin_abort (); +} + +void +bar (int n) +{ + char *p, vla1[n], vla2[n * 2], vla3[n * 3], vla4[n * 4]; + int i; + __builtin_memset (vla4, ' ', n * 4); + #pragma omp parallel for + for (p = vla4 + sizeof (vla1); p < vla4 + sizeof (vla3) - sizeof (vla2) + sizeof (vla1); p += sizeof (vla4) / sizeof (vla4)) + p[0] = '!'; + #pragma omp parallel for + for (i = 0; i < n * 4; i++) + if (vla4[i] != ((i >= n && i < 2 * n) ? '!' : ' ')) + __builtin_abort (); +} + +int +main () +{ + volatile int n; + n = 128; + foo (n); + bar (n); + return 0; +} Index: libgomp/testsuite/libgomp.c/pr81687-1.c =================================================================== --- libgomp/testsuite/libgomp.c/pr81687-1.c (.../tags/gcc_6_4_0_release) (nonexistent) +++ libgomp/testsuite/libgomp.c/pr81687-1.c (.../branches/gcc-6-branch) @@ -0,0 +1,23 @@ +/* PR c/81687 */ +/* { dg-do link } */ +/* { dg-additional-options "-O2" } */ + +extern int printf (const char *, ...); + +int +main () +{ + #pragma omp parallel + { + lab1: + printf ("lab1=%p\n", (void *)(&&lab1)); + } + lab2: + #pragma omp parallel + { + lab3: + printf ("lab2=%p\n", (void *)(&&lab2)); + } + printf ("lab3=%p\n", (void *)(&&lab3)); + return 0; +} Index: libquadmath/ChangeLog =================================================================== --- libquadmath/ChangeLog (.../tags/gcc_6_4_0_release) +++ libquadmath/ChangeLog (.../branches/gcc-6-branch) @@ -1,3 +1,8 @@ +2017-09-15 Jakub Jelinek + + PR libquadmath/65757 + * math/roundq.c: Cherry-pick upstream glibc 2015-04-28 change. + 2017-07-04 Release Manager * GCC 6.4.0 released. Index: libquadmath/math/roundq.c =================================================================== --- libquadmath/math/roundq.c (.../tags/gcc_6_4_0_release) +++ libquadmath/math/roundq.c (.../branches/gcc-6-branch) @@ -1,5 +1,5 @@ /* Round __float128 to integer away from zero. - Copyright (C) 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1997-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997 and Jakub Jelinek , 1999. @@ -32,7 +32,7 @@ GET_FLT128_WORDS64 (i0, i1, x); j0 = ((i0 >> 48) & 0x7fff) - 0x3fff; - if (j0 < 31) + if (j0 < 48) { if (j0 < 0) { Index: libsanitizer/sanitizer_common/sanitizer_linux.cc =================================================================== --- libsanitizer/sanitizer_common/sanitizer_linux.cc (.../tags/gcc_6_4_0_release) +++ libsanitizer/sanitizer_common/sanitizer_linux.cc (.../branches/gcc-6-branch) @@ -546,8 +546,7 @@ } #endif -uptr internal_sigaltstack(const struct sigaltstack *ss, - struct sigaltstack *oss) { +uptr internal_sigaltstack(const void *ss, void *oss) { return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss); } Index: libsanitizer/sanitizer_common/sanitizer_linux.h =================================================================== --- libsanitizer/sanitizer_common/sanitizer_linux.h (.../tags/gcc_6_4_0_release) +++ libsanitizer/sanitizer_common/sanitizer_linux.h (.../branches/gcc-6-branch) @@ -19,7 +19,6 @@ #include "sanitizer_platform_limits_posix.h" struct link_map; // Opaque type returned by dlopen(). -struct sigaltstack; namespace __sanitizer { // Dirent structure for getdents(). Note that this structure is different from @@ -28,8 +27,7 @@ // Syscall wrappers. uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count); -uptr internal_sigaltstack(const struct sigaltstack* ss, - struct sigaltstack* oss); +uptr internal_sigaltstack(const void* ss, void* oss); uptr internal_sigprocmask(int how, __sanitizer_sigset_t *set, __sanitizer_sigset_t *oldset); void internal_sigfillset(__sanitizer_sigset_t *set); Index: libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc =================================================================== --- libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc (.../tags/gcc_6_4_0_release) +++ libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc (.../branches/gcc-6-branch) @@ -267,7 +267,7 @@ // Alternate stack for signal handling. InternalScopedBuffer handler_stack_memory(kHandlerStackSize); - struct sigaltstack handler_stack; + stack_t handler_stack; internal_memset(&handler_stack, 0, sizeof(handler_stack)); handler_stack.ss_sp = handler_stack_memory.data(); handler_stack.ss_size = kHandlerStackSize; Index: libsanitizer/ChangeLog =================================================================== --- libsanitizer/ChangeLog (.../tags/gcc_6_4_0_release) +++ libsanitizer/ChangeLog (.../branches/gcc-6-branch) @@ -1,3 +1,14 @@ +2017-09-07 Matthias Klose + + Backported from mainline + 2017-07-14 Jakub Jelinek + + PR sanitizer/81066 + * sanitizer_common/sanitizer_linux.h: Cherry-pick upstream r307969. + * sanitizer_common/sanitizer_linux.cc: Likewise. + * sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc: Likewise. + * tsan/tsan_platform_linux.cc: Likewise. + 2017-07-04 Release Manager * GCC 6.4.0 released. Index: libsanitizer/tsan/tsan_platform_linux.cc =================================================================== --- libsanitizer/tsan/tsan_platform_linux.cc (.../tags/gcc_6_4_0_release) +++ libsanitizer/tsan/tsan_platform_linux.cc (.../branches/gcc-6-branch) @@ -291,7 +291,7 @@ int ExtractResolvFDs(void *state, int *fds, int nfd) { #if SANITIZER_LINUX int cnt = 0; - __res_state *statp = (__res_state*)state; + struct __res_state *statp = (struct __res_state*)state; for (int i = 0; i < MAXNS && cnt < nfd; i++) { if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) fds[cnt++] = statp->_u._ext.nssocks[i]; Index: libstdc++-v3/configure =================================================================== --- libstdc++-v3/configure (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/configure (.../branches/gcc-6-branch) @@ -619,6 +619,8 @@ ATOMIC_FLAGS ATOMIC_WORD_SRCDIR ATOMICITY_SRCDIR +INCLUDE_DIR_NOTPARALLEL_FALSE +INCLUDE_DIR_NOTPARALLEL_TRUE BUILD_PDF_FALSE BUILD_PDF_TRUE PDFLATEX @@ -11596,7 +11598,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11599 "configure" +#line 11601 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11702,7 +11704,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11705 "configure" +#line 11707 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15388,7 +15390,7 @@ # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15391 "configure" +#line 15393 "configure" int main() { typedef bool atomic_type; @@ -15423,7 +15425,7 @@ rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15426 "configure" +#line 15428 "configure" int main() { typedef short atomic_type; @@ -15458,7 +15460,7 @@ rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15461 "configure" +#line 15463 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -15494,7 +15496,7 @@ rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15497 "configure" +#line 15499 "configure" int main() { typedef long long atomic_type; @@ -15575,7 +15577,7 @@ # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15578 "configure" +#line 15580 "configure" int main() { _Decimal32 d1; @@ -15617,7 +15619,7 @@ # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 15620 "configure" +#line 15622 "configure" template struct same { typedef T2 type; }; @@ -15651,7 +15653,7 @@ rm -f conftest* cat > conftest.$ac_ext << EOF -#line 15654 "configure" +#line 15656 "configure" template struct same { typedef T2 type; }; @@ -81017,7 +81019,19 @@ fi +case "$build" in + *-*-darwin* ) glibcxx_include_dir_notparallel=yes ;; + * ) glibcxx_include_dir_notparallel=no ;; +esac + if test $glibcxx_include_dir_notparallel = "yes"; then + INCLUDE_DIR_NOTPARALLEL_TRUE= + INCLUDE_DIR_NOTPARALLEL_FALSE='#' +else + INCLUDE_DIR_NOTPARALLEL_TRUE='#' + INCLUDE_DIR_NOTPARALLEL_FALSE= +fi + # Propagate the target-specific source directories through the build chain. ATOMICITY_SRCDIR=config/${atomicity_dir} ATOMIC_WORD_SRCDIR=config/${atomic_word_dir} @@ -81696,6 +81710,10 @@ as_fn_error "conditional \"BUILD_PDF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${INCLUDE_DIR_NOTPARALLEL_TRUE}" && test -z "${INCLUDE_DIR_NOTPARALLEL_FALSE}"; then + as_fn_error "conditional \"INCLUDE_DIR_NOTPARALLEL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 Index: libstdc++-v3/python/libstdcxx/v6/printers.py =================================================================== --- libstdc++-v3/python/libstdcxx/v6/printers.py (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/python/libstdcxx/v6/printers.py (.../branches/gcc-6-branch) @@ -1154,7 +1154,7 @@ Recognizes type names that match a regular expression. Replaces them with a formatted string which can use replacement field {N} to refer to the \N subgroup of the regex match. - Type printers are recusively applied to the subgroups. + Type printers are recursively applied to the subgroups. This allows recognizing e.g. "std::vector<(.*), std::allocator<\\1> >" and replacing it with "std::vector<{1}>", omitting the template argument @@ -1335,10 +1335,10 @@ # strip the "fundamentals_v1" inline namespace from these types add_one_template_type_printer(obj, 'optional', 'experimental::fundamentals_v1::optional<(.*)>', - 'experimental::optional<\\1>') + 'experimental::optional<{1}>') add_one_template_type_printer(obj, 'basic_string_view', 'experimental::fundamentals_v1::basic_string_view<(.*), std::char_traits<\\1> >', - 'experimental::basic_string_view<\\1>') + 'experimental::basic_string_view<{1}>') def register_libstdcxx_printers (obj): "Register libstdc++ pretty-printers with objfile Obj." Index: libstdc++-v3/src/filesystem/ops.cc =================================================================== --- libstdc++-v3/src/filesystem/ops.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/filesystem/ops.cc (.../branches/gcc-6-branch) @@ -443,48 +443,68 @@ return false; } + size_t count = from_st->st_size; #ifdef _GLIBCXX_USE_SENDFILE off_t offset = 0; - const auto n = ::sendfile(out.fd, in.fd, &offset, from_st->st_size); - if (n < 0 && (errno == ENOSYS || errno == EINVAL)) + ssize_t n = ::sendfile(out.fd, in.fd, &offset, count); + if (n < 0 && errno != ENOSYS && errno != EINVAL) { -#endif - __gnu_cxx::stdio_filebuf sbin(in.fd, std::ios::in); - __gnu_cxx::stdio_filebuf sbout(out.fd, std::ios::out); - if (sbin.is_open()) - in.fd = -1; - if (sbout.is_open()) - out.fd = -1; - if (from_st->st_size && !(std::ostream(&sbout) << &sbin)) + ec.assign(errno, std::generic_category()); + return false; + } + if ((size_t)n == count) + { + if (!out.close() || !in.close()) { - ec = std::make_error_code(std::errc::io_error); - return false; - } - if (!sbout.close() || !sbin.close()) - { ec.assign(errno, std::generic_category()); return false; } - ec.clear(); return true; + } + else if (n > 0) + count -= n; +#endif // _GLIBCXX_USE_SENDFILE + using std::ios; + __gnu_cxx::stdio_filebuf sbin(in.fd, ios::in|ios::binary); + __gnu_cxx::stdio_filebuf sbout(out.fd, ios::out|ios::binary); + + if (sbin.is_open()) + in.fd = -1; + if (sbout.is_open()) + out.fd = -1; + #ifdef _GLIBCXX_USE_SENDFILE + if (n != 0) + { + if (n < 0) + n = 0; + + const auto p1 = sbin.pubseekoff(n, ios::beg, ios::in); + const auto p2 = sbout.pubseekoff(n, ios::beg, ios::out); + + const std::streampos errpos(std::streamoff(-1)); + if (p1 == errpos || p2 == errpos) + { + ec = std::make_error_code(std::errc::io_error); + return false; + } } - if (n != from_st->st_size) +#endif + + if (count && !(std::ostream(&sbout) << &sbin)) { - ec.assign(errno, std::generic_category()); + ec = std::make_error_code(std::errc::io_error); return false; } - if (!out.close() || !in.close()) + if (!sbout.close() || !sbin.close()) { ec.assign(errno, std::generic_category()); return false; } - ec.clear(); return true; -#endif } } #endif @@ -1199,26 +1219,45 @@ fs::path fs::read_symlink(const path& p, error_code& ec) { + path result; #ifdef _GLIBCXX_HAVE_SYS_STAT_H stat_type st; if (::lstat(p.c_str(), &st)) { ec.assign(errno, std::generic_category()); - return {}; + return result; } - std::string buf(st.st_size, '\0'); - ssize_t len = ::readlink(p.c_str(), &buf.front(), buf.size()); - if (len == -1) + std::string buf(st.st_size ? st.st_size + 1 : 128, '\0'); + do { - ec.assign(errno, std::generic_category()); - return {}; + ssize_t len = ::readlink(p.c_str(), &buf.front(), buf.size()); + if (len == -1) + { + ec.assign(errno, std::generic_category()); + return result; + } + else if (len == (ssize_t)buf.size()) + { + if (buf.size() > 4096) + { + ec.assign(ENAMETOOLONG, std::generic_category()); + return result; + } + buf.resize(buf.size() * 2); + } + else + { + buf.resize(len); + result.assign(buf); + ec.clear(); + break; + } } - ec.clear(); - return path{buf.data(), buf.data()+len}; + while (true); #else ec = std::make_error_code(std::errc::not_supported); - return {}; #endif + return result; } @@ -1235,16 +1274,15 @@ bool fs::remove(const path& p, error_code& ec) noexcept { - if (exists(symlink_status(p, ec))) + if (::remove(p.c_str()) == 0) { - if (::remove(p.c_str()) == 0) - { - ec.clear(); - return true; - } - else - ec.assign(errno, std::generic_category()); + ec.clear(); + return true; } + else if (errno == ENOENT) + ec.clear(); + else + ec.assign(errno, std::generic_category()); return false; } @@ -1253,7 +1291,7 @@ fs::remove_all(const path& p) { error_code ec; - bool result = remove_all(p, ec); + const auto result = remove_all(p, ec); if (ec.value()) _GLIBCXX_THROW_OR_ABORT(filesystem_error("cannot remove all", p, ec)); return result; @@ -1262,14 +1300,28 @@ std::uintmax_t fs::remove_all(const path& p, error_code& ec) noexcept { - auto fs = symlink_status(p, ec); + const auto s = symlink_status(p, ec); + if (!status_known(s)) + return -1; + + ec.clear(); + if (s.type() == file_type::not_found) + return 0; + uintmax_t count = 0; - if (ec.value() == 0 && fs.type() == file_type::directory) - for (directory_iterator d(p, ec), end; ec.value() == 0 && d != end; ++d) - count += fs::remove_all(d->path(), ec); - if (ec.value()) - return -1; - return fs::remove(p, ec) ? ++count : -1; // fs:remove() calls ec.clear() + if (s.type() == file_type::directory) + { + for (directory_iterator d(p, ec), end; !ec && d != end; d.increment(ec)) + count += fs::remove_all(d->path(), ec); + if (ec.value() == ENOENT) + ec.clear(); + else if (ec) + return -1; + } + + if (fs::remove(p, ec)) + ++count; + return ec ? -1 : count; } void Index: libstdc++-v3/src/c++98/misc-inst.cc =================================================================== --- libstdc++-v3/src/c++98/misc-inst.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++98/misc-inst.cc (.../branches/gcc-6-branch) @@ -36,34 +36,6 @@ { _GLIBCXX_BEGIN_NAMESPACE_VERSION - // string related to iostreams - template - basic_istream& - operator>>(basic_istream&, string&); - template - basic_ostream& - operator<<(basic_ostream&, const string&); - template - basic_istream& - getline(basic_istream&, string&, char); - template - basic_istream& - getline(basic_istream&, string&); -#ifdef _GLIBCXX_USE_WCHAR_T - template - basic_istream& - operator>>(basic_istream&, wstring&); - template - basic_ostream& - operator<<(basic_ostream&, const wstring&); - template - basic_istream& - getline(basic_istream&, wstring&, wchar_t); - template - basic_istream& - getline(basic_istream&, wstring&); -#endif - #if _GLIBCXX_USE_CXX11_ABI // C++98 members that are not instantiated by src/c++11/string-inst.cc // because they changed in C++11 to take const_iterator parameters. Index: libstdc++-v3/src/c++11/cow-wstring-inst.cc =================================================================== --- libstdc++-v3/src/c++11/cow-wstring-inst.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/cow-wstring-inst.cc (.../branches/gcc-6-branch) @@ -33,32 +33,8 @@ #define C wchar_t #include "string-inst.cc" -#include -#include - #if ! _GLIBCXX_USE_DUAL_ABI # error This file should not be compiled for this configuration. #endif -namespace std _GLIBCXX_VISIBILITY(default) -{ -_GLIBCXX_BEGIN_NAMESPACE_VERSION - - // XXX these came from c++98/misc-inst.cc, repeat them for COW string - // string related to iostreams - template - basic_istream& - operator>>(basic_istream&, wstring&); - template - basic_ostream& - operator<<(basic_ostream&, const wstring&); - template - basic_istream& - getline(basic_istream&, wstring&, wchar_t); - template - basic_istream& - getline(basic_istream&, wstring&); - -_GLIBCXX_END_NAMESPACE_VERSION -} // namespace #endif Index: libstdc++-v3/src/c++11/Makefile.in =================================================================== --- libstdc++-v3/src/c++11/Makefile.in (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/Makefile.in (.../branches/gcc-6-branch) @@ -97,8 +97,11 @@ system_error.lo thread.lo $(am__objects_1) $(am__objects_2) @ENABLE_DUAL_ABI_TRUE@am__objects_4 = cow-fstream-inst.lo \ @ENABLE_DUAL_ABI_TRUE@ cow-sstream-inst.lo cow-string-inst.lo \ -@ENABLE_DUAL_ABI_TRUE@ cow-wstring-inst.lo cxx11-locale-inst.lo \ -@ENABLE_DUAL_ABI_TRUE@ cxx11-wlocale-inst.lo +@ENABLE_DUAL_ABI_TRUE@ cow-string-io-inst.lo \ +@ENABLE_DUAL_ABI_TRUE@ cow-wstring-inst.lo \ +@ENABLE_DUAL_ABI_TRUE@ cow-wstring-io-inst.lo \ +@ENABLE_DUAL_ABI_TRUE@ cxx11-locale-inst.lo \ +@ENABLE_DUAL_ABI_TRUE@ cxx11-wlocale-inst.lo sso_string.lo @ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_5 = $(am__objects_4) \ @ENABLE_EXTERN_TEMPLATE_TRUE@ ext11-inst.lo fstream-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ ios-inst.lo iostream-inst.lo \ @@ -105,7 +108,9 @@ @ENABLE_EXTERN_TEMPLATE_TRUE@ istream-inst.lo locale-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ ostream-inst.lo sstream-inst.lo \ @ENABLE_EXTERN_TEMPLATE_TRUE@ streambuf-inst.lo string-inst.lo \ -@ENABLE_EXTERN_TEMPLATE_TRUE@ wlocale-inst.lo wstring-inst.lo +@ENABLE_EXTERN_TEMPLATE_TRUE@ string-io-inst.lo wlocale-inst.lo \ +@ENABLE_EXTERN_TEMPLATE_TRUE@ wstring-inst.lo \ +@ENABLE_EXTERN_TEMPLATE_TRUE@ wstring-io-inst.lo am_libc__11convenience_la_OBJECTS = $(am__objects_3) $(am__objects_5) libc__11convenience_la_OBJECTS = $(am_libc__11convenience_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) @@ -395,9 +400,12 @@ @ENABLE_DUAL_ABI_TRUE@ cow-fstream-inst.cc \ @ENABLE_DUAL_ABI_TRUE@ cow-sstream-inst.cc \ @ENABLE_DUAL_ABI_TRUE@ cow-string-inst.cc \ +@ENABLE_DUAL_ABI_TRUE@ cow-string-io-inst.cc \ @ENABLE_DUAL_ABI_TRUE@ cow-wstring-inst.cc \ +@ENABLE_DUAL_ABI_TRUE@ cow-wstring-io-inst.cc \ @ENABLE_DUAL_ABI_TRUE@ cxx11-locale-inst.cc \ -@ENABLE_DUAL_ABI_TRUE@ cxx11-wlocale-inst.cc +@ENABLE_DUAL_ABI_TRUE@ cxx11-wlocale-inst.cc \ +@ENABLE_DUAL_ABI_TRUE@ sso_string.cc # XTEMPLATE_FLAGS = @ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources = @@ -415,8 +423,10 @@ @ENABLE_EXTERN_TEMPLATE_TRUE@ sstream-inst.cc \ @ENABLE_EXTERN_TEMPLATE_TRUE@ streambuf-inst.cc \ @ENABLE_EXTERN_TEMPLATE_TRUE@ string-inst.cc \ +@ENABLE_EXTERN_TEMPLATE_TRUE@ string-io-inst.cc \ @ENABLE_EXTERN_TEMPLATE_TRUE@ wlocale-inst.cc \ -@ENABLE_EXTERN_TEMPLATE_TRUE@ wstring-inst.cc +@ENABLE_EXTERN_TEMPLATE_TRUE@ wstring-inst.cc \ +@ENABLE_EXTERN_TEMPLATE_TRUE@ wstring-io-inst.cc libc__11convenience_la_SOURCES = $(sources) $(inst_sources) Index: libstdc++-v3/src/c++11/cow-string-inst.cc =================================================================== --- libstdc++-v3/src/c++11/cow-string-inst.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/cow-string-inst.cc (.../branches/gcc-6-branch) @@ -29,35 +29,10 @@ #define _GLIBCXX_USE_CXX11_ABI 0 #include "string-inst.cc" -#include -#include - #if ! _GLIBCXX_USE_DUAL_ABI # error This file should not be compiled for this configuration. #endif -namespace std _GLIBCXX_VISIBILITY(default) -{ -_GLIBCXX_BEGIN_NAMESPACE_VERSION - - // These came from c++98/misc-inst.cc, repeat them for COW string - // string related to iostreams. - template - basic_istream& - operator>>(basic_istream&, string&); - template - basic_ostream& - operator<<(basic_ostream&, const string&); - template - basic_istream& - getline(basic_istream&, string&, char); - template - basic_istream& - getline(basic_istream&, string&); - -_GLIBCXX_END_NAMESPACE_VERSION -} // namespace - #ifdef _GLIBCXX_USE_C99_STDINT_TR1 #include #if defined __i386__ || defined __x86_64__ Index: libstdc++-v3/src/c++11/regex.cc =================================================================== --- libstdc++-v3/src/c++11/regex.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/regex.cc (.../branches/gcc-6-branch) @@ -24,11 +24,17 @@ #include #include +#include namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION + void + __throw_regex_error(regex_constants::error_type __ecode + __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode)); } + regex_error::regex_error(regex_constants::error_type __ecode) : std::runtime_error("regex_error"), _M_code(__ecode) { } Index: libstdc++-v3/src/c++11/future.cc =================================================================== --- libstdc++-v3/src/c++11/future.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/future.cc (.../branches/gcc-6-branch) @@ -23,6 +23,7 @@ // . #include +#include namespace { @@ -70,6 +71,10 @@ { _GLIBCXX_BEGIN_NAMESPACE_VERSION + void + __throw_future_error(int __i __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(future_error(make_error_code(future_errc(__i)))); } + const error_category& future_category() noexcept { return __future_category_instance(); } Index: libstdc++-v3/src/c++11/cow-string-io-inst.cc =================================================================== --- libstdc++-v3/src/c++11/cow-string-io-inst.cc (.../tags/gcc_6_4_0_release) (nonexistent) +++ libstdc++-v3/src/c++11/cow-string-io-inst.cc (.../branches/gcc-6-branch) @@ -0,0 +1,59 @@ +// Reference-counted COW string instantiations for I/O -*- C++ -*- + +// Copyright (C) 2014-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 +// . + +// +// ISO C++ 14882: 21 Strings library +// + +#define _GLIBCXX_USE_CXX11_ABI 0 +#include +#include + +#if ! _GLIBCXX_USE_DUAL_ABI +# error This file should not be compiled for this configuration. +#endif + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // The equivalent SSO string instantiations are in c++98/misc-inst.cc, + // repeat them for COW string + + // string related to iostreams. + template + basic_istream& + operator>>(basic_istream&, string&); + template + basic_ostream& + operator<<(basic_ostream&, const string&); + template + basic_istream& + getline(basic_istream&, string&, char); + template + basic_istream& + getline(basic_istream&, string&); + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace Index: libstdc++-v3/src/c++11/string-io-inst.cc =================================================================== --- libstdc++-v3/src/c++11/string-io-inst.cc (.../tags/gcc_6_4_0_release) (nonexistent) +++ libstdc++-v3/src/c++11/string-io-inst.cc (.../branches/gcc-6-branch) @@ -0,0 +1,53 @@ +// SSO string instantiations for I/O -*- C++ -*- + +// Copyright (C) 1997-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 +// . + +// +// ISO C++ 14882: +// + +#define _GLIBCXX_USE_CXX11_ABI 1 +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // string related to iostreams + template + basic_istream& + operator>>(basic_istream&, string&); + template + basic_ostream& + operator<<(basic_ostream&, const string&); + template + basic_istream& + getline(basic_istream&, string&, char); + template + basic_istream& + getline(basic_istream&, string&); + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace Index: libstdc++-v3/src/c++11/functexcept.cc =================================================================== --- libstdc++-v3/src/c++11/functexcept.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/functexcept.cc (.../branches/gcc-6-branch) @@ -20,9 +20,6 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // . -// We don't want to change the type thrown by __throw_ios_failure (yet?) -#define _GLIBCXX_USE_CXX11_ABI 0 - #include #include #include @@ -29,11 +26,6 @@ #include #include #include -#include -#include -#include -#include -#include #include #ifdef _GLIBCXX_USE_NLS @@ -121,27 +113,5 @@ __throw_underflow_error(const char* __s __attribute__((unused))) { _GLIBCXX_THROW_OR_ABORT(underflow_error(_(__s))); } - void - __throw_ios_failure(const char* __s __attribute__((unused))) - { _GLIBCXX_THROW_OR_ABORT(ios_base::failure(_(__s))); } - - void - __throw_system_error(int __i __attribute__((unused))) - { _GLIBCXX_THROW_OR_ABORT(system_error(error_code(__i, - generic_category()))); } - - void - __throw_future_error(int __i __attribute__((unused))) - { _GLIBCXX_THROW_OR_ABORT(future_error(make_error_code(future_errc(__i)))); } - - void - __throw_bad_function_call() - { _GLIBCXX_THROW_OR_ABORT(bad_function_call()); } - - void - __throw_regex_error(regex_constants::error_type __ecode - __attribute__((unused))) - { _GLIBCXX_THROW_OR_ABORT(regex_error(__ecode)); } - _GLIBCXX_END_NAMESPACE_VERSION } // namespace Index: libstdc++-v3/src/c++11/ios.cc =================================================================== --- libstdc++-v3/src/c++11/ios.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/ios.cc (.../branches/gcc-6-branch) @@ -26,13 +26,29 @@ // ISO C++ 14882: 27.4 Iostreams base classes // +// Determines the version of ios_base::failure thrown by __throw_ios_failure. +// If !_GLIBCXX_USE_DUAL_ABI this will get undefined automatically. +#define _GLIBCXX_USE_CXX11_ABI 0 + #include #include +#include +#ifdef _GLIBCXX_USE_NLS +# include +# define _(msgid) gettext (msgid) +#else +# define _(msgid) (msgid) +#endif + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION + void + __throw_ios_failure(const char* __s __attribute__((unused))) + { _GLIBCXX_THROW_OR_ABORT(ios_base::failure(_(__s))); } + // Definitions for static const members of ios_base. const ios_base::fmtflags ios_base::boolalpha; const ios_base::fmtflags ios_base::dec; Index: libstdc++-v3/src/c++11/sso_string.cc =================================================================== --- libstdc++-v3/src/c++11/sso_string.cc (.../tags/gcc_6_4_0_release) (nonexistent) +++ libstdc++-v3/src/c++11/sso_string.cc (.../branches/gcc-6-branch) @@ -0,0 +1,107 @@ +// Helper for accessing __cxx11::string from the ABI -*- C++ -*- + +// Copyright (C) 2014-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 +// . + + +#define _GLIBCXX_USE_CXX11_ABI 1 +#define __sso_string __sso_stringxxx +#include +#include +#undef __sso_string + +#if ! _GLIBCXX_USE_DUAL_ABI +# error This file should not be compiled for this configuration. +#endif + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wabi-tag" + // Redefine __sso_string so that we can define and export its members + // in terms of the SSO std::string. + struct __sso_string + { + struct __str + { + const char* _M_p; + size_t _M_string_length; + char _M_local_buf[16]; + }; + + union { + __str _M_s; + char _M_bytes[sizeof(_M_s)]; + std::string _M_str; + }; + + __sso_string(); + __sso_string(const std::string& s); + __sso_string(const char*, size_t n); + __sso_string(const __sso_string&) noexcept; + __sso_string& operator=(const __sso_string&) noexcept; + ~__sso_string(); + __sso_string(__sso_string&&) noexcept; + __sso_string& operator=(__sso_string&&) noexcept; + }; +#pragma GCC diagnostic pop + + __sso_string::__sso_string() : _M_str() { } + +#if _GLIBCXX_USE_CXX11_ABI + static_assert(sizeof(__sso_string) == sizeof(std::string), + "sizeof(std::string) has changed"); + static_assert(alignof(__sso_string) == alignof(std::string), + "alignof(std::string) has changed"); + + // This constructor is defined in src/c++11/cow-stdexcept.cc for COW strings + __sso_string::__sso_string(const std::string& s) : _M_str(s) { } +#endif + + __sso_string::__sso_string(const char* s, size_t n) : _M_str(s, n) { } + + __sso_string::__sso_string(const __sso_string& s) noexcept + : _M_str(s._M_str) { } + + __sso_string& + __sso_string::operator=(const __sso_string& s) noexcept + { + _M_str = s._M_str; + return *this; + } + + __sso_string::~__sso_string() { _M_str.~basic_string(); } + + __sso_string::__sso_string(__sso_string&& s) noexcept + : _M_str(std::move(s._M_str)) { } + + __sso_string& + __sso_string::operator=(__sso_string&& s) noexcept + { + _M_str = std::move(s._M_str); + return *this; + } + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace Index: libstdc++-v3/src/c++11/system_error.cc =================================================================== --- libstdc++-v3/src/c++11/system_error.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/system_error.cc (.../branches/gcc-6-branch) @@ -75,6 +75,12 @@ { _GLIBCXX_BEGIN_NAMESPACE_VERSION + void + __throw_system_error(int __i __attribute__((unused))) + { + _GLIBCXX_THROW_OR_ABORT(system_error(error_code(__i, generic_category()))); + } + error_category::~error_category() noexcept = default; const error_category& @@ -112,73 +118,5 @@ } #endif -#if _GLIBCXX_USE_DUAL_ABI -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wabi-tag" - // Redefine __sso_string so that we can define and export its members - // in terms of the SSO std::string. - struct __sso_string - { - struct __str - { - const char* _M_p; - size_t _M_string_length; - char _M_local_buf[16]; - }; - - union { - __str _M_s; - char _M_bytes[sizeof(_M_s)]; - std::string _M_str; - }; - - __sso_string(); - __sso_string(const std::string& s); - __sso_string(const char*, size_t n); - __sso_string(const __sso_string&) noexcept; - __sso_string& operator=(const __sso_string&) noexcept; - ~__sso_string(); - __sso_string(__sso_string&&) noexcept; - __sso_string& operator=(__sso_string&&) noexcept; - }; -#pragma GCC diagnostic pop - - __sso_string::__sso_string() : _M_str() { } - -#if _GLIBCXX_USE_CXX11_ABI - static_assert(sizeof(__sso_string) == sizeof(std::string), - "sizeof(std::string) has changed"); - static_assert(alignof(__sso_string) == alignof(std::string), - "alignof(std::string) has changed"); - - // This constructor is defined in src/c++11/cow-stdexcept.cc for COW strings - __sso_string::__sso_string(const std::string& s) : _M_str(s) { } -#endif - - __sso_string::__sso_string(const char* s, size_t n) : _M_str(s, n) { } - - __sso_string::__sso_string(const __sso_string& s) noexcept - : _M_str(s._M_str) { } - - __sso_string& - __sso_string::operator=(const __sso_string& s) noexcept - { - _M_str = s._M_str; - return *this; - } - - __sso_string::~__sso_string() { _M_str.~basic_string(); } - - __sso_string::__sso_string(__sso_string&& s) noexcept - : _M_str(std::move(s._M_str)) { } - - __sso_string& - __sso_string::operator=(__sso_string&& s) noexcept - { - _M_str = std::move(s._M_str); - return *this; - } -#endif // _GLIBCXX_USE_DUAL_ABI - _GLIBCXX_END_NAMESPACE_VERSION } // namespace Index: libstdc++-v3/src/c++11/functional.cc =================================================================== --- libstdc++-v3/src/c++11/functional.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/functional.cc (.../branches/gcc-6-branch) @@ -23,11 +23,16 @@ // . #include +#include namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION + void + __throw_bad_function_call() + { _GLIBCXX_THROW_OR_ABORT(bad_function_call()); } + bad_function_call::~bad_function_call() noexcept = default; const char* Index: libstdc++-v3/src/c++11/cow-wstring-io-inst.cc =================================================================== --- libstdc++-v3/src/c++11/cow-wstring-io-inst.cc (.../tags/gcc_6_4_0_release) (nonexistent) +++ libstdc++-v3/src/c++11/cow-wstring-io-inst.cc (.../branches/gcc-6-branch) @@ -0,0 +1,63 @@ +// Reference-counted COW wide string instantiations for I/O -*- C++ -*- + +// Copyright (C) 2014-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 +// . + +// +// ISO C++ 14882: 21 Strings library +// + +#define _GLIBCXX_USE_CXX11_ABI 0 +#include + +#ifdef _GLIBCXX_USE_WCHAR_T +#include +#include + +#if ! _GLIBCXX_USE_DUAL_ABI +# error This file should not be compiled for this configuration. +#endif + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // The equivalent SSO wstring instantiations are in c++98/misc-inst.cc, + // repeat them for COW wstring + + // string related to iostreams + template + basic_istream& + operator>>(basic_istream&, wstring&); + template + basic_ostream& + operator<<(basic_ostream&, const wstring&); + template + basic_istream& + getline(basic_istream&, wstring&, wchar_t); + template + basic_istream& + getline(basic_istream&, wstring&); + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace +#endif Index: libstdc++-v3/src/c++11/wstring-io-inst.cc =================================================================== --- libstdc++-v3/src/c++11/wstring-io-inst.cc (.../tags/gcc_6_4_0_release) (nonexistent) +++ libstdc++-v3/src/c++11/wstring-io-inst.cc (.../branches/gcc-6-branch) @@ -0,0 +1,55 @@ +// SSO string instantiations for I/O -*- C++ -*- + +// Copyright (C) 1997-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 +// . + +// +// ISO C++ 14882: +// + +#define _GLIBCXX_USE_CXX11_ABI 1 +#include +#include +#include + +namespace std _GLIBCXX_VISIBILITY(default) +{ +_GLIBCXX_BEGIN_NAMESPACE_VERSION + + // string related to iostreams +#ifdef _GLIBCXX_USE_WCHAR_T + template + basic_istream& + operator>>(basic_istream&, wstring&); + template + basic_ostream& + operator<<(basic_ostream&, const wstring&); + template + basic_istream& + getline(basic_istream&, wstring&, wchar_t); + template + basic_istream& + getline(basic_istream&, wstring&); +#endif + +_GLIBCXX_END_NAMESPACE_VERSION +} // namespace Index: libstdc++-v3/src/c++11/snprintf_lite.cc =================================================================== --- libstdc++-v3/src/c++11/snprintf_lite.cc (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/snprintf_lite.cc (.../branches/gcc-6-branch) @@ -52,7 +52,7 @@ const size_t __len = __bufend - __buf + 1; const char __err[] = "not enough space for format expansion " - "(Please submit full bug report at http://gcc.gnu.org/bugs.html):\n "; + "(Please submit full bug report at https://gcc.gnu.org/bugs/):\n "; const size_t __errlen = sizeof(__err) - 1; char *const __e @@ -71,19 +71,17 @@ // Returns number of characters appended, or -1 if BUFSIZE is too small. int __concat_size_t(char *__buf, size_t __bufsize, size_t __val) { - // __int_to_char is explicitly instantiated and available only for - // some, but not all, types. See locale-inst.cc. -#ifdef _GLIBCXX_USE_LONG_LONG - unsigned long long __val2 = __val; -#else - unsigned long __val2 = __val; -#endif // Long enough for decimal representation. - int __ilen = 3 * sizeof(__val2); + int __ilen = 3 * sizeof(__val); char *__cs = static_cast(__builtin_alloca(__ilen)); - size_t __len = std::__int_to_char(__cs + __ilen, __val2, - std::__num_base::_S_atoms_out, - std::ios_base::dec, true); + char* __out = __cs + __ilen; + do + { + *--__out = "0123456789"[__val % 10]; + __val /= 10; + } + while (__val != 0); + size_t __len = __cs + __ilen - __out; if (__bufsize < __len) return -1; Index: libstdc++-v3/src/c++11/Makefile.am =================================================================== --- libstdc++-v3/src/c++11/Makefile.am (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/src/c++11/Makefile.am (.../branches/gcc-6-branch) @@ -82,9 +82,12 @@ cow-fstream-inst.cc \ cow-sstream-inst.cc \ cow-string-inst.cc \ + cow-string-io-inst.cc \ cow-wstring-inst.cc \ + cow-wstring-io-inst.cc \ cxx11-locale-inst.cc \ - cxx11-wlocale-inst.cc + cxx11-wlocale-inst.cc \ + sso_string.cc else extra_string_inst_sources = endif @@ -103,8 +106,10 @@ sstream-inst.cc \ streambuf-inst.cc \ string-inst.cc \ + string-io-inst.cc \ wlocale-inst.cc \ - wstring-inst.cc + wstring-inst.cc \ + wstring-io-inst.cc else # XTEMPLATE_FLAGS = inst_sources = Index: libstdc++-v3/configure.ac =================================================================== --- libstdc++-v3/configure.ac (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/configure.ac (.../branches/gcc-6-branch) @@ -456,6 +456,12 @@ test $ac_cv_prog_DBLATEX = "yes" && test $ac_cv_prog_PDFLATEX = "yes") +case "$build" in + *-*-darwin* ) glibcxx_include_dir_notparallel=yes ;; + * ) glibcxx_include_dir_notparallel=no ;; +esac +AM_CONDITIONAL(INCLUDE_DIR_NOTPARALLEL, + test $glibcxx_include_dir_notparallel = "yes") # Propagate the target-specific source directories through the build chain. ATOMICITY_SRCDIR=config/${atomicity_dir} Index: libstdc++-v3/doc/xml/manual/status_cxxtr1.xml =================================================================== --- libstdc++-v3/doc/xml/manual/status_cxxtr1.xml (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/xml/manual/status_cxxtr1.xml (.../branches/gcc-6-branch) @@ -22,8 +22,7 @@ -This page describes the TR1 support in mainline GCC SVN, not in any particular -release. +This page describes the TR1 support in the GCC 6 series. Index: libstdc++-v3/doc/xml/manual/status_cxx1998.xml =================================================================== --- libstdc++-v3/doc/xml/manual/status_cxx1998.xml (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/xml/manual/status_cxx1998.xml (.../branches/gcc-6-branch) @@ -18,8 +18,7 @@ -This page describes the C++ support in mainline GCC SVN, not in any -particular release. +This page describes the C++ support in the GCC 6 series. Index: libstdc++-v3/doc/xml/manual/extensions.xml =================================================================== --- libstdc++-v3/doc/xml/manual/extensions.xml (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/xml/manual/extensions.xml (.../branches/gcc-6-branch) @@ -502,7 +502,7 @@ demangling. - If you have read the source + If you have read the source documentation for namespace abi then you are aware of the cross-vendor C++ ABI in use by GCC. One of the exposed functions is used for demangling, Index: libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml =================================================================== --- libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/xml/manual/status_cxxtr24733.xml (.../branches/gcc-6-branch) @@ -16,8 +16,7 @@ -This page describes the TR 24733 support in mainline GCC SVN, not in any -particular release. +This page describes the TR 24733 support in the GCC 6 series. Index: libstdc++-v3/doc/html/bk02.html =================================================================== --- libstdc++-v3/doc/html/bk02.html (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/html/bk02.html (.../branches/gcc-6-branch) @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file Index: libstdc++-v3/doc/html/bk03.html =================================================================== --- libstdc++-v3/doc/html/bk03.html (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/html/bk03.html (.../branches/gcc-6-branch) @@ -1,2 +1,2 @@ - \ No newline at end of file + \ No newline at end of file Index: libstdc++-v3/doc/html/faq.html =================================================================== --- libstdc++-v3/doc/html/faq.html (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/html/faq.html (.../branches/gcc-6-branch) @@ -1,5 +1,5 @@ -Frequently Asked Questions

Frequently Asked Questions

Frequently Asked Questions

The GNU C++ Library

Short Contents

+The GNU C++ Library

The GNU C++ Library

Short Contents

Copyright (C) 2008-2016 FSF Index: libstdc++-v3/doc/html/api.html =================================================================== --- libstdc++-v3/doc/html/api.html (.../tags/gcc_6_4_0_release) +++ libstdc++-v3/doc/html/api.html (.../branches/gcc-6-branch) @@ -1,5 +1,5 @@ -The GNU C++ Library API Reference

The GNU C++ Library API Reference

The GNU C++ Library API Reference