[gcc-7] 291/354: * Update to SVN 20170913 (r252733) from the gcc-7-branch.
Ximin Luo
infinity0 at debian.org
Thu Nov 23 15:51:21 UTC 2017
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository gcc-7.
commit 89c3050a30413ddb312d2fd9891026d3570f4b1f
Author: doko <doko at 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>
Date: Wed Sep 13 21:08:53 2017 +0000
* Update to SVN 20170913 (r252733) from the gcc-7-branch.
git-svn-id: svn+ssh://svn.debian.org/svn/gcccvs/branches/sid/gcc-7@9673 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
---
debian/changelog | 8 +-
debian/patches/svn-updates.diff | 4379 ++++++++++++++++++++++++++++++++++++++-
2 files changed, 4376 insertions(+), 11 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index ba6f226..e70af52 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,15 +1,17 @@
gcc-7 (7.2.0-5) UNRELEASED; urgency=medium
- * Update to SVN 20170912 (r251998) from the gcc-7-branch.
+ * Update to SVN 20170913 (r252733) from the gcc-7-branch.
- Fix PR c/81687, PR c/45784, PR c++/81852, PR target/82181 (xtensa),
PR target/80695 (PPC), PR target/81988 (SPARC), PR middle-end/81768,
PR sanitizer/81923, PR target/81621, PR driver/81650,
- PR middle-end/81052, PR tree-optimization/81987, PR bootstrap/81926.
+ PR middle-end/81052, PR tree-optimization/81987, PR bootstrap/81926,
+ PR libstdc++/79162, PR libstdc++/81468, PR libstdc++/81835,
+ PR libstdc++/70483, PR libstdc++/70483, PR target/81833 (PPC).
* Enable libgo tests and rebuilds with make -C (Svante Signell).
Closes: #873929.
* Fix PR sanitizer/77631, support separate debug info in libbacktrace.
- -- Matthias Klose <doko at debian.org> Tue, 12 Sep 2017 10:27:32 +0200
+ -- Matthias Klose <doko at debian.org> Wed, 13 Sep 2017 22:52:19 +0200
gcc-7 (7.2.0-4) unstable; urgency=medium
diff --git a/debian/patches/svn-updates.diff b/debian/patches/svn-updates.diff
index aa7aa4e..8ba4cc9 100644
--- a/debian/patches/svn-updates.diff
+++ b/debian/patches/svn-updates.diff
@@ -1,10 +1,10 @@
-# DP: updates from the 7 branch upto 20170912 (r251998).
+# DP: updates from the 7 branch upto 20170913 (r252733).
last_update()
{
cat > ${dir}LAST_UPDATED <EOF
-Tue Sep 12 10:04:40 CEST 2017
-Tue Sep 12 08:04:40 UTC 2017 (revision 251998)
+Wed Sep 13 22:44:13 CEST 2017
+Wed Sep 13 20:44:13 UTC 2017 (revision 252733)
EOF
}
@@ -178,6 +178,482 @@ Index: libsanitizer/ChangeLog
2017-08-14 Release Manager
* GCC 7.2.0 released.
+Index: libstdc++-v3/doc/xml/manual/status_cxx2017.xml
+===================================================================
+--- a/src/libstdc++-v3/doc/xml/manual/status_cxx2017.xml (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/doc/xml/manual/status_cxx2017.xml (.../branches/gcc-7-branch)
+@@ -482,7 +482,6 @@
+ </row>
+
+ <row>
+- <?dbhtml bgcolor="#B0B0B0" ?>
+ <entry> Constexpr for <code>std::char_traits</code> </entry>
+ <entry>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0426r1.html">
+@@ -489,8 +488,8 @@
+ P0426R1
+ </link>
+ </entry>
+- <entry align="center"> 7 (partial) </entry>
+- <entry><code> ??? </code></entry>
++ <entry align="center"> 7.3 </entry>
++ <entry><code> __cpp_lib_constexpr_char_traits >= 201611 </code></entry>
+ </row>
+
+ <row>
+Index: libstdc++-v3/doc/xml/manual/extensions.xml
+===================================================================
+--- a/src/libstdc++-v3/doc/xml/manual/extensions.xml (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/doc/xml/manual/extensions.xml (.../branches/gcc-7-branch)
+@@ -502,7 +502,7 @@
+ <quote>demangling.</quote>
+ </para>
+ <para>
+- If you have read the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01115.html">source
++ If you have read the <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html">source
+ documentation for <code>namespace abi</code></link> 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/html/manual/status.html
+===================================================================
+--- a/src/libstdc++-v3/doc/html/manual/status.html (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/doc/html/manual/status.html (.../branches/gcc-7-branch)
+@@ -684,11 +684,11 @@
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0505r0.html" target="_top">
+ P0505R0
+ </a>
+- </td><td align="center"> 7 </td><td align="left"><code class="code"> ??? </code></td></tr><tr bgcolor="#B0B0B0"><td align="left"> Constexpr for <code class="code">std::char_traits</code> </td><td align="left">
++ </td><td align="center"> 7 </td><td align="left"><code class="code"> ??? </code></td></tr><tr><td align="left"> Constexpr for <code class="code">std::char_traits</code> </td><td align="left">
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0426r1.html" target="_top">
+ P0426R1
+ </a>
+- </td><td align="center"> 7 (partial) </td><td align="left"><code class="code"> ??? </code></td></tr><tr><td align="left"> Integrating <code class="code">std::string_view</code> and <code class="code">std::string</code> </td><td align="left">
++ </td><td align="center"> 7.3 </td><td align="left"><code class="code"> __cpp_lib_constexpr_char_traits >= 201611 </code></td></tr><tr><td align="left"> Integrating <code class="code">std::string_view</code> and <code class="code">std::string</code> </td><td align="left">
+ <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0254r2.pdf" target="_top">
+ P0254R2
+ </a>
+@@ -961,4 +961,4 @@
+ </td></tr></tbody></table></div></div><br class="table-break" /></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="intro.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="intro.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="license.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Part I.
+ Introduction
+
+- </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> License</td></tr></table></div></body></html>
+\ No newline at end of file
++ </td><td width="20%" align="center"><a accesskey="h" href="../index.html">Home</a></td><td width="40%" align="right" valign="top"> License</td></tr></table></div></body></html>
+Index: libstdc++-v3/doc/html/manual/ext_demangling.html
+===================================================================
+--- a/src/libstdc++-v3/doc/html/manual/ext_demangling.html (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/doc/html/manual/ext_demangling.html (.../branches/gcc-7-branch)
+@@ -7,7 +7,7 @@
+ original C++ source identifiers is called
+ <span class="quote">“<span class="quote">demangling.</span>”</span>
+ </p><p>
+- If you have read the <a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01115.html" target="_top">source
++ If you have read the <a class="link" href="http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/namespaces.html" target="_top">source
+ documentation for <code class="code">namespace abi</code></a> 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/doxygen/mainpage.html
+===================================================================
+--- a/src/libstdc++-v3/doc/doxygen/mainpage.html (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/doc/doxygen/mainpage.html (.../branches/gcc-7-branch)
+@@ -28,7 +28,7 @@
+
+ <p>There are two types of documentation for libstdc++. One is the
+ distribution documentation, which can be read online
+- <a href="http://gcc.gnu.org/onlinedocs/libstdc++/index.html">here</a>
++ <a href="https://gcc.gnu.org/onlinedocs/libstdc++/index.html">here</a>
+ or offline from the file doc/html/index.html in the library source
+ directory.
+ </p>
+@@ -78,11 +78,11 @@
+ pages. See the section "Documentation Style"
+ in <code>doc/xml/manual/appendix_contributing.xml</code> in the
+ source tree for how to create (and write) the doxygen markup.
+- This style guide can also be viewed on the <a href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01apas04.html">web</a>.
++ This style guide can also be viewed on the <a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_hacking.html">web</a>.
+
+ <h2>License, Copyright, and Other Lawyerly Verbosity</h2>
+ <p>The libstdc++ documentation is released under
+- <a href="http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01s02.html">
++ <a href="https://gcc.gnu.org/onlinedocs/libstdc++/manual/appendix_gpl.html">
+ these terms</a>.
+ </p>
+ <p>Part of the generated documentation involved comments and notes from
+Index: libstdc++-v3/include/std/string_view
+===================================================================
+--- a/src/libstdc++-v3/include/std/string_view (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/include/std/string_view (.../branches/gcc-7-branch)
+@@ -106,7 +106,7 @@
+ _M_str{__str}
+ { }
+
+- basic_string_view&
++ constexpr basic_string_view&
+ operator=(const basic_string_view&) noexcept = default;
+
+ // [string.view.iterators], iterators
+@@ -127,19 +127,19 @@
+ cend() const noexcept
+ { return this->_M_str + this->_M_len; }
+
+- const_reverse_iterator
++ constexpr const_reverse_iterator
+ rbegin() const noexcept
+ { return const_reverse_iterator(this->end()); }
+
+- const_reverse_iterator
++ constexpr const_reverse_iterator
+ rend() const noexcept
+ { return const_reverse_iterator(this->begin()); }
+
+- const_reverse_iterator
++ constexpr const_reverse_iterator
+ crbegin() const noexcept
+ { return const_reverse_iterator(this->end()); }
+
+- const_reverse_iterator
++ constexpr const_reverse_iterator
+ crend() const noexcept
+ { return const_reverse_iterator(this->begin()); }
+
+@@ -208,7 +208,7 @@
+
+ // [string.view.modifiers], modifiers:
+
+- void
++ constexpr void
+ remove_prefix(size_type __n)
+ {
+ __glibcxx_assert(this->_M_len >= __n);
+@@ -216,15 +216,16 @@
+ this->_M_len -= __n;
+ }
+
+- void
++ constexpr void
+ remove_suffix(size_type __n)
+ { this->_M_len -= __n; }
+
+- void
++ constexpr void
+ swap(basic_string_view& __sv) noexcept
+ {
+- std::swap(this->_M_len, __sv._M_len);
+- std::swap(this->_M_str, __sv._M_str);
++ auto __tmp = *this;
++ *this = __sv;
++ __sv = __tmp;
+ }
+
+
+@@ -261,7 +262,7 @@
+ __pos, this->size()), basic_string_view{});
+ }
+
+- int
++ constexpr int
+ compare(basic_string_view __str) const noexcept
+ {
+ int __ret = traits_type::compare(this->_M_str, __str._M_str,
+@@ -271,24 +272,24 @@
+ return __ret;
+ }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1, basic_string_view __str) const
+ { return this->substr(__pos1, __n1).compare(__str); }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1,
+ basic_string_view __str, size_type __pos2, size_type __n2) const
+ { return this->substr(__pos1, __n1).compare(__str.substr(__pos2, __n2)); }
+
+- int
++ constexpr int
+ compare(const _CharT* __str) const noexcept
+ { return this->compare(basic_string_view{__str}); }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1, const _CharT* __str) const
+ { return this->substr(__pos1, __n1).compare(basic_string_view{__str}); }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1,
+ const _CharT* __str, size_type __n2) const
+ {
+@@ -296,78 +297,78 @@
+ .compare(basic_string_view(__str, __n2));
+ }
+
+- size_type
++ constexpr size_type
+ find(basic_string_view __str, size_type __pos = 0) const noexcept
+ { return this->find(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find(_CharT __c, size_type __pos=0) const noexcept;
+
+- size_type
++ constexpr size_type
+ find(const _CharT* __str, size_type __pos, size_type __n) const noexcept;
+
+- size_type
++ constexpr size_type
+ find(const _CharT* __str, size_type __pos=0) const noexcept
+ { return this->find(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ rfind(basic_string_view __str, size_type __pos = npos) const noexcept
+ { return this->rfind(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ rfind(_CharT __c, size_type __pos = npos) const noexcept;
+
+- size_type
++ constexpr size_type
+ rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept;
+
+- size_type
++ constexpr size_type
+ rfind(const _CharT* __str, size_type __pos = npos) const noexcept
+ { return this->rfind(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ find_first_of(basic_string_view __str, size_type __pos = 0) const noexcept
+ { return this->find_first_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const noexcept
+ { return this->find(__c, __pos); }
+
+- size_type
++ constexpr size_type
+ find_first_of(const _CharT* __str, size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_first_of(const _CharT* __str, size_type __pos = 0) const noexcept
+ { return this->find_first_of(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ find_last_of(basic_string_view __str,
+ size_type __pos = npos) const noexcept
+ { return this->find_last_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_last_of(_CharT __c, size_type __pos=npos) const noexcept
+ { return this->rfind(__c, __pos); }
+
+- size_type
++ constexpr size_type
+ find_last_of(const _CharT* __str, size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_last_of(const _CharT* __str, size_type __pos = npos) const noexcept
+ { return this->find_last_of(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ find_first_not_of(basic_string_view __str,
+ size_type __pos = 0) const noexcept
+ { return this->find_first_not_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const noexcept;
+
+- size_type
++ constexpr size_type
+ find_first_not_of(const _CharT* __str,
+ size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_first_not_of(const _CharT* __str, size_type __pos = 0) const noexcept
+ {
+ return this->find_first_not_of(__str, __pos,
+@@ -374,19 +375,19 @@
+ traits_type::length(__str));
+ }
+
+- size_type
++ constexpr size_type
+ find_last_not_of(basic_string_view __str,
+ size_type __pos = npos) const noexcept
+ { return this->find_last_not_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_last_not_of(_CharT __c, size_type __pos = npos) const noexcept;
+
+- size_type
++ constexpr size_type
+ find_last_not_of(const _CharT* __str,
+ size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_last_not_of(const _CharT* __str,
+ size_type __pos = npos) const noexcept
+ {
+@@ -394,7 +395,7 @@
+ traits_type::length(__str));
+ }
+
+- size_type
++ constexpr size_type
+ _M_check(size_type __pos, const char* __s) const
+ {
+ if (__pos > this->size())
+@@ -405,7 +406,7 @@
+ }
+
+ // NB: _M_limit doesn't check for a bad __pos value.
+- size_type
++ constexpr size_type
+ _M_limit(size_type __pos, size_type __off) const _GLIBCXX_NOEXCEPT
+ {
+ const bool __testoff = __off < this->size() - __pos;
+@@ -445,109 +446,109 @@
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator==(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.size() == __y.size() && __x.compare(__y) == 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator==(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.size() == __y.size() && __x.compare(__y) == 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator==(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.size() == __y.size() && __x.compare(__y) == 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator!=(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return !(__x == __y); }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator!=(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return !(__x == __y); }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator!=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return !(__x == __y); }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator< (basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) < 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator< (basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) < 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator< (__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) < 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator> (basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) > 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator> (basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) > 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator> (__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) > 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator<=(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) <= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator<=(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) <= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator<=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) <= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator>=(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) >= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator>=(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) >= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator>=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) >= 0; }
Index: libstdc++-v3/include/std/type_traits
===================================================================
--- a/src/libstdc++-v3/include/std/type_traits (.../tags/gcc_7_2_0_release)
@@ -221,6 +697,20 @@ Index: libstdc++-v3/include/std/type_traits
# define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1
# endif
#endif
+Index: libstdc++-v3/include/std/chrono
+===================================================================
+--- a/src/libstdc++-v3/include/std/chrono (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/include/std/chrono (.../branches/gcc-7-branch)
+@@ -622,7 +622,8 @@
+ { }
+
+ // conversions
+- template<typename _Dur2>
++ template<typename _Dur2,
++ typename = _Require<is_convertible<_Dur2, _Dur>>>
+ constexpr time_point(const time_point<clock, _Dur2>& __t)
+ : __d(__t.time_since_epoch())
+ { }
Index: libstdc++-v3/include/std/istream
===================================================================
--- a/src/libstdc++-v3/include/std/istream (.../tags/gcc_7_2_0_release)
@@ -293,6 +783,424 @@ Index: libstdc++-v3/include/std/sstream
}
~__xfer_bufptrs()
+Index: libstdc++-v3/include/experimental/string_view
+===================================================================
+--- a/src/libstdc++-v3/include/experimental/string_view (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/include/experimental/string_view (.../branches/gcc-7-branch)
+@@ -219,7 +219,7 @@
+
+ // [string.view.modifiers], modifiers:
+
+- void
++ constexpr void
+ remove_prefix(size_type __n)
+ {
+ __glibcxx_assert(this->_M_len >= __n);
+@@ -227,15 +227,16 @@
+ this->_M_len -= __n;
+ }
+
+- void
++ constexpr void
+ remove_suffix(size_type __n)
+ { this->_M_len -= __n; }
+
+- void
++ constexpr void
+ swap(basic_string_view& __sv) noexcept
+ {
+- std::swap(this->_M_len, __sv._M_len);
+- std::swap(this->_M_str, __sv._M_str);
++ auto __tmp = *this;
++ *this = __sv;
++ __sv = __tmp;
+ }
+
+
+@@ -285,7 +286,7 @@
+ __pos, this->size()), basic_string_view{});
+ }
+
+- int
++ constexpr int
+ compare(basic_string_view __str) const noexcept
+ {
+ int __ret = traits_type::compare(this->_M_str, __str._M_str,
+@@ -295,24 +296,24 @@
+ return __ret;
+ }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1, basic_string_view __str) const
+ { return this->substr(__pos1, __n1).compare(__str); }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1,
+ basic_string_view __str, size_type __pos2, size_type __n2) const
+ { return this->substr(__pos1, __n1).compare(__str.substr(__pos2, __n2)); }
+
+- int
++ constexpr int
+ compare(const _CharT* __str) const noexcept
+ { return this->compare(basic_string_view{__str}); }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1, const _CharT* __str) const
+ { return this->substr(__pos1, __n1).compare(basic_string_view{__str}); }
+
+- int
++ constexpr int
+ compare(size_type __pos1, size_type __n1,
+ const _CharT* __str, size_type __n2) const
+ {
+@@ -320,78 +321,78 @@
+ .compare(basic_string_view(__str, __n2));
+ }
+
+- size_type
++ constexpr size_type
+ find(basic_string_view __str, size_type __pos = 0) const noexcept
+ { return this->find(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find(_CharT __c, size_type __pos=0) const noexcept;
+
+- size_type
++ constexpr size_type
+ find(const _CharT* __str, size_type __pos, size_type __n) const noexcept;
+
+- size_type
++ constexpr size_type
+ find(const _CharT* __str, size_type __pos=0) const noexcept
+ { return this->find(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ rfind(basic_string_view __str, size_type __pos = npos) const noexcept
+ { return this->rfind(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ rfind(_CharT __c, size_type __pos = npos) const noexcept;
+
+- size_type
++ constexpr size_type
+ rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept;
+
+- size_type
++ constexpr size_type
+ rfind(const _CharT* __str, size_type __pos = npos) const noexcept
+ { return this->rfind(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ find_first_of(basic_string_view __str, size_type __pos = 0) const noexcept
+ { return this->find_first_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const noexcept
+ { return this->find(__c, __pos); }
+
+- size_type
++ constexpr size_type
+ find_first_of(const _CharT* __str, size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_first_of(const _CharT* __str, size_type __pos = 0) const noexcept
+ { return this->find_first_of(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ find_last_of(basic_string_view __str,
+ size_type __pos = npos) const noexcept
+ { return this->find_last_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_last_of(_CharT __c, size_type __pos=npos) const noexcept
+ { return this->rfind(__c, __pos); }
+
+- size_type
++ constexpr size_type
+ find_last_of(const _CharT* __str, size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_last_of(const _CharT* __str, size_type __pos = npos) const noexcept
+ { return this->find_last_of(__str, __pos, traits_type::length(__str)); }
+
+- size_type
++ constexpr size_type
+ find_first_not_of(basic_string_view __str,
+ size_type __pos = 0) const noexcept
+ { return this->find_first_not_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const noexcept;
+
+- size_type
++ constexpr size_type
+ find_first_not_of(const _CharT* __str,
+ size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_first_not_of(const _CharT* __str, size_type __pos = 0) const noexcept
+ {
+ return this->find_first_not_of(__str, __pos,
+@@ -398,19 +399,19 @@
+ traits_type::length(__str));
+ }
+
+- size_type
++ constexpr size_type
+ find_last_not_of(basic_string_view __str,
+ size_type __pos = npos) const noexcept
+ { return this->find_last_not_of(__str._M_str, __pos, __str._M_len); }
+
+- size_type
++ constexpr size_type
+ find_last_not_of(_CharT __c, size_type __pos = npos) const noexcept;
+
+- size_type
++ constexpr size_type
+ find_last_not_of(const _CharT* __str,
+ size_type __pos, size_type __n) const;
+
+- size_type
++ constexpr size_type
+ find_last_not_of(const _CharT* __str,
+ size_type __pos = npos) const noexcept
+ {
+@@ -452,109 +453,109 @@
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator==(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.size() == __y.size() && __x.compare(__y) == 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator==(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.size() == __y.size() && __x.compare(__y) == 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator==(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.size() == __y.size() && __x.compare(__y) == 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator!=(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return !(__x == __y); }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator!=(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return !(__x == __y); }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator!=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return !(__x == __y); }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator< (basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) < 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator< (basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) < 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator< (__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) < 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator> (basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) > 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator> (basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) > 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator> (__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) > 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator<=(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) <= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator<=(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) <= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator<=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) <= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator>=(basic_string_view<_CharT, _Traits> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) >= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator>=(basic_string_view<_CharT, _Traits> __x,
+ __detail::__idt<basic_string_view<_CharT, _Traits>> __y) noexcept
+ { return __x.compare(__y) >= 0; }
+
+ template<typename _CharT, typename _Traits>
+- inline bool
++ constexpr bool
+ operator>=(__detail::__idt<basic_string_view<_CharT, _Traits>> __x,
+ basic_string_view<_CharT, _Traits> __y) noexcept
+ { return __x.compare(__y) >= 0; }
+Index: libstdc++-v3/include/experimental/bits/string_view.tcc
+===================================================================
+--- a/src/libstdc++-v3/include/experimental/bits/string_view.tcc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/include/experimental/bits/string_view.tcc (.../branches/gcc-7-branch)
+@@ -49,7 +49,7 @@
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find(const _CharT* __str, size_type __pos, size_type __n) const noexcept
+ {
+@@ -70,7 +70,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find(_CharT __c, size_type __pos) const noexcept
+ {
+@@ -86,7 +86,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept
+ {
+@@ -106,7 +106,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ rfind(_CharT __c, size_type __pos) const noexcept
+ {
+@@ -123,7 +123,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_first_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -139,7 +139,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_last_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -160,7 +160,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_first_not_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -172,7 +172,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_first_not_of(_CharT __c, size_type __pos) const noexcept
+ {
+@@ -183,7 +183,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_last_not_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -204,7 +204,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_last_not_of(_CharT __c, size_type __pos) const noexcept
+ {
Index: libstdc++-v3/include/ext/new_allocator.h
===================================================================
--- a/src/libstdc++-v3/include/ext/new_allocator.h (.../tags/gcc_7_2_0_release)
@@ -376,7 +1284,488 @@ Index: libstdc++-v3/include/bits/basic_string.h
===================================================================
--- a/src/libstdc++-v3/include/bits/basic_string.h (.../tags/gcc_7_2_0_release)
+++ b/src/libstdc++-v3/include/bits/basic_string.h (.../branches/gcc-7-branch)
-@@ -2918,7 +2918,10 @@
+@@ -117,6 +117,21 @@
+ __and_<is_convertible<const _Tp&, __sv_type>,
+ __not_<is_convertible<const _Tp&, const _CharT*>>>::value,
+ _Res>;
++
++ // Allows an implicit conversion to __sv_type.
++ static __sv_type
++ _S_to_string_view(__sv_type __svt) noexcept
++ { return __svt; }
++
++ // Wraps a string_view by explicit conversion and thus
++ // allows to add an internal constructor that does not
++ // participate in overload resolution when a string_view
++ // is provided.
++ struct __sv_wrapper
++ {
++ explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { }
++ __sv_type _M_sv;
++ };
+ #endif
+
+ // Use empty-base optimization: http://www.cantrip.org/emptyopt.html
+@@ -593,7 +608,7 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Construct string from a substring of a string_view.
+- * @param __t Source string view.
++ * @param __t Source object convertible to string view.
+ * @param __pos The index of the first character to copy from __t.
+ * @param __n The number of characters to copy from __t.
+ * @param __a Allocator to use.
+@@ -601,16 +616,27 @@
+ template<typename _Tp, typename = _If_sv<_Tp, void>>
+ basic_string(const _Tp& __t, size_type __pos, size_type __n,
+ const _Alloc& __a = _Alloc())
+- : basic_string(__sv_type(__t).substr(__pos, __n), __a) { }
++ : basic_string(_S_to_string_view(__t).substr(__pos, __n), __a) { }
+
+ /**
+ * @brief Construct string from a string_view.
+- * @param __sv Source string view.
++ * @param __t Source object convertible to string view.
+ * @param __a Allocator to use (default is default allocator).
+ */
++ template<typename _Tp, typename = _If_sv<_Tp, void>>
++ explicit
++ basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
++ : basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { }
++
++ /**
++ * @brief Only internally used: Construct string from a string view
++ * wrapper.
++ * @param __svw string view wrapper.
++ * @param __a Allocator to use.
++ */
+ explicit
+- basic_string(__sv_type __sv, const _Alloc& __a = _Alloc())
+- : basic_string(__sv.data(), __sv.size(), __a) { }
++ basic_string(__sv_wrapper __svw, const _Alloc& __a)
++ : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { }
+ #endif // C++17
+
+ /**
+@@ -756,12 +782,12 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Set value to string constructed from a string_view.
+- * @param __sv A string_view.
++ * @param __svt An object convertible to string_view.
+ */
+- template<typename _Tp>
+- _If_sv<_Tp, basic_string&>
+- operator=(_Tp __sv)
+- { return this->assign(__sv); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ operator=(const _Tp& __svt)
++ { return this->assign(__svt); }
+
+ /**
+ * @brief Convert to a string_view.
+@@ -768,7 +794,7 @@
+ * @return A string_view.
+ */
+ operator __sv_type() const noexcept
+- { return __sv_type(data(), size()); }
++ { return __sv_type(data(), size()); }
+ #endif // C++17
+
+ // Iterators:
+@@ -1157,12 +1183,13 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Append a string_view.
+- * @param __sv The string_view to be appended.
++ * @param __svt An object convertible to string_view to be appended.
+ * @return Reference to this string.
+ */
+- basic_string&
+- operator+=(__sv_type __sv)
+- { return this->append(__sv); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ operator+=(const _Tp& __svt)
++ { return this->append(__svt); }
+ #endif // C++17
+
+ /**
+@@ -1265,22 +1292,26 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Append a string_view.
+- * @param __sv The string_view to be appended.
++ * @param __svt An object convertible to string_view to be appended.
+ * @return Reference to this string.
+ */
+- basic_string&
+- append(__sv_type __sv)
+- { return this->append(__sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ append(const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->append(__sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Append a range of characters from a string_view.
+- * @param __sv The string_view to be appended from.
++ * @param __svt An object convertible to string_view to be appended from.
+ * @param __pos The position in the string_view to append from.
+ * @param __n The number of characters to append from the string_view.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
+- _If_sv<_Tp, basic_string&>
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
+ append(const _Tp& __svt, size_type __pos, size_type __n = npos)
+ {
+ __sv_type __sv = __svt;
+@@ -1433,21 +1464,25 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Set value from a string_view.
+- * @param __sv The source string_view.
++ * @param __svt The source object convertible to string_view.
+ * @return Reference to this string.
+ */
+- basic_string&
+- assign(__sv_type __sv)
+- { return this->assign(__sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ assign(const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->assign(__sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Set value from a range of characters in a string_view.
+- * @param __sv The source string_view.
++ * @param __svt The source object convertible to string_view.
+ * @param __pos The position in the string_view to assign from.
+ * @param __n The number of characters to assign.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
++ template<typename _Tp>
+ _If_sv<_Tp, basic_string&>
+ assign(const _Tp& __svt, size_type __pos, size_type __n = npos)
+ {
+@@ -1692,23 +1727,27 @@
+ /**
+ * @brief Insert a string_view.
+ * @param __pos Iterator referencing position in string to insert at.
+- * @param __sv The string_view to insert.
++ * @param __svt The object convertible to string_view to insert.
+ * @return Reference to this string.
+ */
+- basic_string&
+- insert(size_type __pos, __sv_type __sv)
+- { return this->insert(__pos, __sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ insert(size_type __pos, const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->insert(__pos, __sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Insert a string_view.
+ * @param __pos Iterator referencing position in string to insert at.
+- * @param __sv The string_view to insert from.
++ * @param __svt The object convertible to string_view to insert from.
+ * @param __pos Iterator referencing position in string_view to insert
+ * from.
+ * @param __n The number of characters to insert.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
++ template<typename _Tp>
+ _If_sv<_Tp, basic_string&>
+ insert(size_type __pos1, const _Tp& __svt,
+ size_type __pos2, size_type __n = npos)
+@@ -2120,23 +2159,27 @@
+ * @brief Replace range of characters with string_view.
+ * @param __pos The position to replace at.
+ * @param __n The number of characters to replace.
+- * @param __sv The string_view to insert.
++ * @param __svt The object convertible to string_view to insert.
+ * @return Reference to this string.
+ */
+- basic_string&
+- replace(size_type __pos, size_type __n, __sv_type __sv)
+- { return this->replace(__pos, __n, __sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ replace(size_type __pos, size_type __n, const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->replace(__pos, __n, __sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Replace range of characters with string_view.
+ * @param __pos1 The position to replace at.
+ * @param __n1 The number of characters to replace.
+- * @param __sv The string_view to insert from.
++ * @param __svt The object convertible to string_view to insert from.
+ * @param __pos2 The position in the string_view to insert from.
+ * @param __n2 The number of characters to insert.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
++ template<typename _Tp>
+ _If_sv<_Tp, basic_string&>
+ replace(size_type __pos1, size_type __n1, const _Tp& __svt,
+ size_type __pos2, size_type __n2 = npos)
+@@ -2153,12 +2196,16 @@
+ to replace at.
+ * @param __i2 An iterator referencing the end position
+ for the replace.
+- * @param __sv The string_view to insert from.
++ * @param __svt The object convertible to string_view to insert from.
+ * @return Reference to this string.
+ */
+- basic_string&
+- replace(const_iterator __i1, const_iterator __i2, __sv_type __sv)
+- { return this->replace(__i1 - begin(), __i2 - __i1, __sv); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ replace(const_iterator __i1, const_iterator __i2, const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->replace(__i1 - begin(), __i2 - __i1, __sv);
++ }
+ #endif // C++17
+
+ private:
+@@ -2288,13 +2335,18 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find position of a string_view.
+- * @param __sv The string_view to locate.
++ * @param __svt The object convertible to string_view to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ */
+- size_type
+- find(__sv_type __sv, size_type __pos = 0) const noexcept
+- { return this->find(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find(const _Tp& __svt, size_type __pos = 0) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -2345,13 +2397,18 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find last position of a string_view.
+- * @param __sv The string_view to locate.
++ * @param __svt The object convertible to string_view to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of start of last occurrence.
+ */
+- size_type
+- rfind(__sv_type __sv, size_type __pos = npos) const noexcept
+- { return this->rfind(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ rfind(const _Tp& __svt, size_type __pos = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->rfind(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -2419,13 +2476,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find position of a character of a string_view.
+- * @param __sv A string_view containing characters to locate.
++ * @param __svt An object convertible to string_view containing
++ * characters to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ */
+- size_type
+- find_first_of(__sv_type __sv, size_type __pos = 0) const noexcept
+- { return this->find_first_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_first_of(const _Tp& __svt, size_type __pos = 0) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_first_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -2497,13 +2560,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find last position of a character of string.
+- * @param __sv A string_view containing characters to locate.
++ * @param __svt An object convertible to string_view containing
++ * characters to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ */
+- size_type
+- find_last_of(__sv_type __sv, size_type __pos = npos) const noexcept
+- { return this->find_last_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_last_of(const _Tp& __svt, size_type __pos = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_last_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -2574,13 +2643,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find position of a character not in a string_view.
+- * @param __sv A string_view containing characters to avoid.
++ * @param __svt A object convertible to string_view containing
++ * characters to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ */
+- size_type
+- find_first_not_of(__sv_type __sv, size_type __pos = 0) const noexcept
+- { return this->find_first_not_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_first_not_of(const _Tp& __svt, size_type __pos = 0) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_first_not_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -2650,13 +2725,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find last position of a character not in a string_view.
+- * @param __sv A string_view containing characters to avoid.
++ * @param __svt An object convertible to string_view containing
++ * characters to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ */
+- size_type
+- find_last_not_of(__sv_type __sv, size_type __pos = npos) const noexcept
+- { return this->find_last_not_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_last_not_of(const _Tp& __svt, size_type __pos = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_last_not_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -2754,46 +2835,57 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Compare to a string_view.
+- * @param __sv A string_view to compare against.
++ * @param __svt An object convertible to string_view to compare against.
+ * @return Integer < 0, 0, or > 0.
+ */
+- int
+- compare(__sv_type __sv) const
+- {
+- const size_type __size = this->size();
+- const size_type __osize = __sv.size();
+- const size_type __len = std::min(__size, __osize);
++ template<typename _Tp>
++ _If_sv<_Tp, int>
++ compare(const _Tp& __svt) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ const size_type __size = this->size();
++ const size_type __osize = __sv.size();
++ const size_type __len = std::min(__size, __osize);
+
+- int __r = traits_type::compare(_M_data(), __sv.data(), __len);
+- if (!__r)
+- __r = _S_compare(__size, __osize);
+- return __r;
+- }
++ int __r = traits_type::compare(_M_data(), __sv.data(), __len);
++ if (!__r)
++ __r = _S_compare(__size, __osize);
++ return __r;
++ }
+
+ /**
+ * @brief Compare to a string_view.
+ * @param __pos A position in the string to start comparing from.
+ * @param __n The number of characters to compare.
+- * @param __sv A string_view to compare against.
++ * @param __svt An object convertible to string_view to compare
++ * against.
+ * @return Integer < 0, 0, or > 0.
+ */
+- int
+- compare(size_type __pos, size_type __n, __sv_type __sv) const
+- { return __sv_type(*this).substr(__pos, __n).compare(__sv); }
++ template<typename _Tp>
++ _If_sv<_Tp, int>
++ compare(size_type __pos, size_type __n, const _Tp& __svt) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return __sv_type(*this).substr(__pos, __n).compare(__sv);
++ }
+
+ /**
+ * @brief Compare to a string_view.
+ * @param __pos1 A position in the string to start comparing from.
+ * @param __n1 The number of characters to compare.
+- * @param __sv A string_view to compare against.
++ * @param __svt An object convertible to string_view to compare
++ * against.
+ * @param __pos2 A position in the string_view to start comparing from.
+ * @param __n2 The number of characters to compare.
+ * @return Integer < 0, 0, or > 0.
+ */
+- template <typename _Tp>
++ template<typename _Tp>
+ _If_sv<_Tp, int>
+ compare(size_type __pos1, size_type __n1, const _Tp& __svt,
+ size_type __pos2, size_type __n2 = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
+ {
+ __sv_type __sv = __svt;
+ return __sv_type(*this)
+@@ -2918,7 +3010,10 @@
int
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const;
@@ -388,6 +1777,507 @@ Index: libstdc++-v3/include/bits/basic_string.h
_GLIBCXX_END_NAMESPACE_CXX11
#else // !_GLIBCXX_USE_CXX11_ABI
// Reference-counted COW string implentation
+@@ -3345,6 +3440,21 @@
+ __and_<is_convertible<const _Tp&, __sv_type>,
+ __not_<is_convertible<const _Tp&, const _CharT*>>>::value,
+ _Res>;
++
++ // Allows an implicit conversion to __sv_type.
++ static __sv_type
++ _S_to_string_view(__sv_type __svt) noexcept
++ { return __svt; }
++
++ // Wraps a string_view by explicit conversion and thus
++ // allows to add an internal constructor that does not
++ // participate in overload resolution when a string_view
++ // is provided.
++ struct __sv_wrapper
++ {
++ explicit __sv_wrapper(__sv_type __sv) noexcept : _M_sv(__sv) { }
++ __sv_type _M_sv;
++ };
+ #endif
+
+ public:
+@@ -3471,7 +3581,7 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Construct string from a substring of a string_view.
+- * @param __t Source string view.
++ * @param __t Source object convertible to string view.
+ * @param __pos The index of the first character to copy from __t.
+ * @param __n The number of characters to copy from __t.
+ * @param __a Allocator to use.
+@@ -3479,16 +3589,27 @@
+ template<typename _Tp, typename = _If_sv<_Tp, void>>
+ basic_string(const _Tp& __t, size_type __pos, size_type __n,
+ const _Alloc& __a = _Alloc())
+- : basic_string(__sv_type(__t).substr(__pos, __n), __a) { }
++ : basic_string(_S_to_string_view(__t).substr(__pos, __n), __a) { }
+
+ /**
+ * @brief Construct string from a string_view.
+- * @param __sv Source string view.
++ * @param __t Source object convertible to string view.
+ * @param __a Allocator to use (default is default allocator).
+ */
++ template<typename _Tp, typename = _If_sv<_Tp, void>>
++ explicit
++ basic_string(const _Tp& __t, const _Alloc& __a = _Alloc())
++ : basic_string(__sv_wrapper(_S_to_string_view(__t)), __a) { }
++
++ /**
++ * @brief Only internally used: Construct string from a string view
++ * wrapper.
++ * @param __svw string view wrapper.
++ * @param __a Allocator to use.
++ */
+ explicit
+- basic_string(__sv_type __sv, const _Alloc& __a = _Alloc())
+- : basic_string(__sv.data(), __sv.size(), __a) { }
++ basic_string(__sv_wrapper __svw, const _Alloc& __a)
++ : basic_string(__svw._M_sv.data(), __svw._M_sv.size(), __a) { }
+ #endif // C++17
+
+ /**
+@@ -3559,12 +3680,12 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Set value to string constructed from a string_view.
+- * @param __sv A string_view.
++ * @param __svt An object convertible to string_view.
+ */
+ template<typename _Tp>
+ _If_sv<_Tp, basic_string&>
+- operator=(_Tp __sv)
+- { return this->assign(__sv); }
++ operator=(const _Tp& __svt)
++ { return this->assign(__svt); }
+
+ /**
+ * @brief Convert to a string_view.
+@@ -3981,12 +4102,13 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Append a string_view.
+- * @param __sv The string_view to be appended.
++ * @param __svt The object convertible to string_view to be appended.
+ * @return Reference to this string.
+ */
+- basic_string&
+- operator+=(__sv_type __sv)
+- { return this->append(__sv); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ operator+=(const _Tp& __svt)
++ { return this->append(__svt); }
+ #endif // C++17
+
+ /**
+@@ -4072,22 +4194,27 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Append a string_view.
+- * @param __sv The string_view to be appended.
++ * @param __svt The object convertible to string_view to be appended.
+ * @return Reference to this string.
+ */
+- basic_string&
+- append(__sv_type __sv)
+- { return this->append(__sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ append(const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->append(__sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Append a range of characters from a string_view.
+- * @param __sv The string_view to be appended from.
++ * @param __svt The object convertible to string_view to be appended
++ * from.
+ * @param __pos The position in the string_view to append from.
+ * @param __n The number of characters to append from the string_view.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
+- _If_sv<_Tp, basic_string&>
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
+ append(const _Tp& __svt, size_type __pos, size_type __n = npos)
+ {
+ __sv_type __sv = __svt;
+@@ -4225,23 +4352,27 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Set value from a string_view.
+- * @param __sv The source string_view.
++ * @param __svt The source object convertible to string_view.
+ * @return Reference to this string.
+ */
+- basic_string&
+- assign(__sv_type __sv)
+- { return this->assign(__sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ assign(const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->assign(__sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Set value from a range of characters in a string_view.
+- * @param __sv The source string_view.
++ * @param __svt The source object convertible to string_view.
+ * @param __pos The position in the string_view to assign from.
+ * @param __n The number of characters to assign.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
+- _If_sv<_Tp, basic_string&>
+- assign(const _Tp& __svt, size_type __pos, size_type __n = npos)
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ assign(const _Tp& __svt, size_type __pos, size_type __n = npos)
+ {
+ __sv_type __sv = __svt;
+ return assign(__sv.data()
+@@ -4429,25 +4560,29 @@
+ /**
+ * @brief Insert a string_view.
+ * @param __pos Iterator referencing position in string to insert at.
+- * @param __sv The string_view to insert.
++ * @param __svt The object convertible to string_view to insert.
+ * @return Reference to this string.
+ */
+- basic_string&
+- insert(size_type __pos, __sv_type __sv)
+- { return this->insert(__pos, __sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ insert(size_type __pos, const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->insert(__pos, __sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Insert a string_view.
+ * @param __pos Iterator referencing position in string to insert at.
+- * @param __sv The string_view to insert from.
++ * @param __svt The object convertible to string_view to insert from.
+ * @param __pos Iterator referencing position in string_view to insert
+ * from.
+ * @param __n The number of characters to insert.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
+- _If_sv<_Tp, basic_string&>
+- insert(size_type __pos1, const _Tp& __svt,
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ insert(size_type __pos1, const _Tp& __svt,
+ size_type __pos2, size_type __n = npos)
+ {
+ __sv_type __sv = __svt;
+@@ -4790,7 +4925,7 @@
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1.base(), __k2 - __k1);
+ }
+-
++
+ #if __cplusplus >= 201103L
+ /**
+ * @brief Replace range of characters with initializer_list.
+@@ -4816,31 +4951,35 @@
+ * @brief Replace range of characters with string_view.
+ * @param __pos The position to replace at.
+ * @param __n The number of characters to replace.
+- * @param __sv The string_view to insert.
++ * @param __svt The object convertible to string_view to insert.
+ * @return Reference to this string.
+ */
+- basic_string&
+- replace(size_type __pos, size_type __n, __sv_type __sv)
+- { return this->replace(__pos, __n, __sv.data(), __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ replace(size_type __pos, size_type __n, const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->replace(__pos, __n, __sv.data(), __sv.size());
++ }
+
+ /**
+ * @brief Replace range of characters with string_view.
+ * @param __pos1 The position to replace at.
+ * @param __n1 The number of characters to replace.
+- * @param __sv The string_view to insert from.
++ * @param __svt The object convertible to string_view to insert from.
+ * @param __pos2 The position in the string_view to insert from.
+ * @param __n2 The number of characters to insert.
+ * @return Reference to this string.
+ */
+- template <typename _Tp>
+- _If_sv<_Tp, basic_string&>
+- replace(size_type __pos1, size_type __n1, const _Tp& __svt,
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ replace(size_type __pos1, size_type __n1, const _Tp& __svt,
+ size_type __pos2, size_type __n2 = npos)
+ {
+ __sv_type __sv = __svt;
+- return this->replace(__pos1, __n1, __sv.data()
+- + __sv._M_check(__pos2, "basic_string::replace"),
+- __sv._M_limit(__pos2, __n2));
++ return this->replace(__pos1, __n1,
++ __sv.data() + __sv._M_check(__pos2, "basic_string::replace"),
++ __sv._M_limit(__pos2, __n2));
+ }
+
+ /**
+@@ -4849,12 +4988,16 @@
+ to replace at.
+ * @param __i2 An iterator referencing the end position
+ for the replace.
+- * @param __sv The string_view to insert from.
++ * @param __svt The object convertible to string_view to insert from.
+ * @return Reference to this string.
+ */
+- basic_string&
+- replace(const_iterator __i1, const_iterator __i2, __sv_type __sv)
+- { return this->replace(__i1 - begin(), __i2 - __i1, __sv); }
++ template<typename _Tp>
++ _If_sv<_Tp, basic_string&>
++ replace(const_iterator __i1, const_iterator __i2, const _Tp& __svt)
++ {
++ __sv_type __sv = __svt;
++ return this->replace(__i1 - begin(), __i2 - __i1, __sv);
++ }
+ #endif // C++17
+
+ private:
+@@ -5059,13 +5202,18 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find position of a string_view.
+- * @param __sv The string_view to locate.
++ * @param __svt The object convertible to string_view to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of start of first occurrence.
+ */
+- size_type
+- find(__sv_type __sv, size_type __pos = 0) const noexcept
+- { return this->find(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find(const _Tp& __svt, size_type __pos = 0) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -5132,13 +5280,18 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find last position of a string_view.
+- * @param __sv The string_view to locate.
++ * @param __svt The object convertible to string_view to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of start of last occurrence.
+ */
+- size_type
+- rfind(__sv_type __sv, size_type __pos = npos) const noexcept
+- { return this->rfind(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ rfind(const _Tp& __svt, size_type __pos = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->rfind(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -5210,13 +5363,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find position of a character of a string_view.
+- * @param __sv A string_view containing characters to locate.
++ * @param __svt An object convertible to string_view containing
++ * characters to locate.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ */
+- size_type
+- find_first_of(__sv_type __sv, size_type __pos = 0) const noexcept
+- { return this->find_first_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_first_of(const _Tp& __svt, size_type __pos = 0) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_first_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -5288,13 +5447,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find last position of a character of string.
+- * @param __sv A string_view containing characters to locate.
++ * @param __svt An object convertible to string_view containing
++ * characters to locate.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ */
+- size_type
+- find_last_of(__sv_type __sv, size_type __pos = npos) const noexcept
+- { return this->find_last_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_last_of(const _Tp& __svt, size_type __pos = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_last_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -5363,13 +5528,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find position of a character not in a string_view.
+- * @param __sv A string_view containing characters to avoid.
++ * @param __svt An object convertible to string_view containing
++ * characters to avoid.
+ * @param __pos Index of character to search from (default 0).
+ * @return Index of first occurrence.
+ */
+- size_type
+- find_first_not_of(__sv_type __sv, size_type __pos = 0) const noexcept
+- { return this->find_first_not_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_first_not_of(const _Tp& __svt, size_type __pos = 0) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_first_not_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -5439,13 +5610,19 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Find last position of a character not in a string_view.
+- * @param __sv A string_view containing characters to avoid.
++ * @param __svt An object convertible to string_view containing
++ * characters to avoid.
+ * @param __pos Index of character to search back from (default end).
+ * @return Index of last occurrence.
+ */
+- size_type
+- find_last_not_of(__sv_type __sv, size_type __pos = npos) const noexcept
+- { return this->find_last_not_of(__sv.data(), __pos, __sv.size()); }
++ template<typename _Tp>
++ _If_sv<_Tp, size_type>
++ find_last_not_of(const _Tp& __svt, size_type __pos = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return this->find_last_not_of(__sv.data(), __pos, __sv.size());
++ }
+ #endif // C++17
+
+ /**
+@@ -5495,46 +5672,57 @@
+ #if __cplusplus > 201402L
+ /**
+ * @brief Compare to a string_view.
+- * @param __sv A string_view to compare against.
++ * @param __svt An object convertible to string_view to compare against.
+ * @return Integer < 0, 0, or > 0.
+ */
+- int
+- compare(__sv_type __sv) const
+- {
+- const size_type __size = this->size();
+- const size_type __osize = __sv.size();
+- const size_type __len = std::min(__size, __osize);
++ template<typename _Tp>
++ _If_sv<_Tp, int>
++ compare(const _Tp& __svt) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ const size_type __size = this->size();
++ const size_type __osize = __sv.size();
++ const size_type __len = std::min(__size, __osize);
+
+- int __r = traits_type::compare(_M_data(), __sv.data(), __len);
+- if (!__r)
+- __r = _S_compare(__size, __osize);
+- return __r;
+- }
++ int __r = traits_type::compare(_M_data(), __sv.data(), __len);
++ if (!__r)
++ __r = _S_compare(__size, __osize);
++ return __r;
++ }
+
+ /**
+ * @brief Compare to a string_view.
+ * @param __pos A position in the string to start comparing from.
+ * @param __n The number of characters to compare.
+- * @param __sv A string_view to compare against.
++ * @param __svt An object convertible to string_view to compare
++ * against.
+ * @return Integer < 0, 0, or > 0.
+ */
+- int
+- compare(size_type __pos, size_type __n, __sv_type __sv) const
+- { return __sv_type(*this).substr(__pos, __n).compare(__sv); }
++ template<typename _Tp>
++ _If_sv<_Tp, int>
++ compare(size_type __pos, size_type __n, const _Tp& __svt) const
++ noexcept(is_same<_Tp, __sv_type>::value)
++ {
++ __sv_type __sv = __svt;
++ return __sv_type(*this).substr(__pos, __n).compare(__sv);
++ }
+
+ /**
+ * @brief Compare to a string_view.
+ * @param __pos1 A position in the string to start comparing from.
+ * @param __n1 The number of characters to compare.
+- * @param __sv A string_view to compare against.
++ * @param __svt An object convertible to string_view to compare
++ * against.
+ * @param __pos2 A position in the string_view to start comparing from.
+ * @param __n2 The number of characters to compare.
+ * @return Integer < 0, 0, or > 0.
+ */
+- template <typename _Tp>
++ template<typename _Tp>
+ _If_sv<_Tp, int>
+ compare(size_type __pos1, size_type __n1, const _Tp& __svt,
+ size_type __pos2, size_type __n2 = npos) const
++ noexcept(is_same<_Tp, __sv_type>::value)
+ {
+ __sv_type __sv = __svt;
+ return __sv_type(*this)
Index: libstdc++-v3/include/bits/istream.tcc
===================================================================
--- a/src/libstdc++-v3/include/bits/istream.tcc (.../tags/gcc_7_2_0_release)
@@ -479,11 +2369,433 @@ Index: libstdc++-v3/include/bits/sstream.tcc
const __size_type __max_size = _M_string.max_size();
const bool __testput = this->pptr() < this->epptr();
if (__builtin_expect(!__testput && __capacity == __max_size, false))
+Index: libstdc++-v3/include/bits/char_traits.h
+===================================================================
+--- a/src/libstdc++-v3/include/bits/char_traits.h (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/include/bits/char_traits.h (.../branches/gcc-7-branch)
+@@ -40,6 +40,10 @@
+ #include <bits/postypes.h> // For streampos
+ #include <cwchar> // For WEOF, wmemmove, wmemset, etc.
+
++#ifndef _GLIBCXX_ALWAYS_INLINE
++#define _GLIBCXX_ALWAYS_INLINE inline __attribute__((__always_inline__))
++#endif
++
+ namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+@@ -139,7 +143,7 @@
+ { return !eq_int_type(__c, eof()) ? __c : to_int_type(char_type()); }
+ };
+
+-// #define __cpp_lib_constexpr_char_traits 201611
++#define __cpp_lib_constexpr_char_traits 201611
+
+ template<typename _CharT>
+ _GLIBCXX14_CONSTEXPR int
+@@ -212,6 +216,42 @@
+ {
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
++#if __cplusplus > 201402
++ /**
++ * @brief Determine whether the characters of a NULL-terminated
++ * string are known at compile time.
++ * @param __s The string.
++ *
++ * Assumes that _CharT is a built-in character type.
++ */
++ template<typename _CharT>
++ static _GLIBCXX_ALWAYS_INLINE constexpr bool
++ __constant_string_p(const _CharT* __s)
++ {
++ while (__builtin_constant_p(*__s) && *__s)
++ __s++;
++ return __builtin_constant_p(*__s);
++ }
++
++ /**
++ * @brief Determine whether the characters of a character array are
++ * known at compile time.
++ * @param __a The character array.
++ * @param __n Number of characters.
++ *
++ * Assumes that _CharT is a built-in character type.
++ */
++ template<typename _CharT>
++ static _GLIBCXX_ALWAYS_INLINE constexpr bool
++ __constant_char_array_p(const _CharT* __a, size_t __n)
++ {
++ size_t __i = 0;
++ while (__builtin_constant_p(__a[__i]) && __i < __n)
++ __i++;
++ return __i == __n;
++ }
++#endif
++
+ // 21.1
+ /**
+ * @brief Basis for explicit traits specializations.
+@@ -256,21 +296,39 @@
+ < static_cast<unsigned char>(__c2));
+ }
+
+- static /* _GLIBCXX17_CONSTEXPR */ int
++ static _GLIBCXX17_CONSTEXPR int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
++#if __cplusplus > 201402
++ if (__builtin_constant_p(__n)
++ && __constant_char_array_p(__s1, __n)
++ && __constant_char_array_p(__s2, __n))
++ return __gnu_cxx::char_traits<char_type>::compare(__s1, __s2, __n);
++#endif
+ if (__n == 0)
+ return 0;
+ return __builtin_memcmp(__s1, __s2, __n);
+ }
+
+- static /* _GLIBCXX17_CONSTEXPR */ size_t
++ static _GLIBCXX17_CONSTEXPR size_t
+ length(const char_type* __s)
+- { return __builtin_strlen(__s); }
++ {
++#if __cplusplus > 201402
++ if (__constant_string_p(__s))
++ return __gnu_cxx::char_traits<char_type>::length(__s);
++#endif
++ return __builtin_strlen(__s);
++ }
+
+- static /* _GLIBCXX17_CONSTEXPR */ const char_type*
++ static _GLIBCXX17_CONSTEXPR const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
++#if __cplusplus > 201402
++ if (__builtin_constant_p(__n)
++ && __builtin_constant_p(__a)
++ && __constant_char_array_p(__s, __n))
++ return __gnu_cxx::char_traits<char_type>::find(__s, __n, __a);
++#endif
+ if (__n == 0)
+ return 0;
+ return static_cast<const char_type*>(__builtin_memchr(__s, __a, __n));
+@@ -347,24 +405,45 @@
+ lt(const char_type& __c1, const char_type& __c2) _GLIBCXX_NOEXCEPT
+ { return __c1 < __c2; }
+
+- static /* _GLIBCXX17_CONSTEXPR */ int
++ static _GLIBCXX17_CONSTEXPR int
+ compare(const char_type* __s1, const char_type* __s2, size_t __n)
+ {
++#if __cplusplus > 201402
++ if (__builtin_constant_p(__n)
++ && __constant_char_array_p(__s1, __n)
++ && __constant_char_array_p(__s2, __n))
++ return __gnu_cxx::char_traits<char_type>::compare(__s1, __s2, __n);
++#endif
+ if (__n == 0)
+ return 0;
+- return wmemcmp(__s1, __s2, __n);
++ else
++ return wmemcmp(__s1, __s2, __n);
+ }
+
+- static /* _GLIBCXX17_CONSTEXPR */ size_t
++ static _GLIBCXX17_CONSTEXPR size_t
+ length(const char_type* __s)
+- { return wcslen(__s); }
++ {
++#if __cplusplus > 201402
++ if (__constant_string_p(__s))
++ return __gnu_cxx::char_traits<char_type>::length(__s);
++ else
++#endif
++ return wcslen(__s);
++ }
+
+- static /* _GLIBCXX17_CONSTEXPR */ const char_type*
++ static _GLIBCXX17_CONSTEXPR const char_type*
+ find(const char_type* __s, size_t __n, const char_type& __a)
+ {
++#if __cplusplus > 201402
++ if (__builtin_constant_p(__n)
++ && __builtin_constant_p(__a)
++ && __constant_char_array_p(__s, __n))
++ return __gnu_cxx::char_traits<char_type>::find(__s, __n, __a);
++#endif
+ if (__n == 0)
+ return 0;
+- return wmemchr(__s, __a, __n);
++ else
++ return wmemchr(__s, __a, __n);
+ }
+
+ static char_type*
+Index: libstdc++-v3/include/bits/string_view.tcc
+===================================================================
+--- a/src/libstdc++-v3/include/bits/string_view.tcc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/include/bits/string_view.tcc (.../branches/gcc-7-branch)
+@@ -45,7 +45,7 @@
+ _GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find(const _CharT* __str, size_type __pos, size_type __n) const noexcept
+ {
+@@ -66,7 +66,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find(_CharT __c, size_type __pos) const noexcept
+ {
+@@ -82,7 +82,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ rfind(const _CharT* __str, size_type __pos, size_type __n) const noexcept
+ {
+@@ -102,7 +102,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ rfind(_CharT __c, size_type __pos) const noexcept
+ {
+@@ -119,7 +119,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_first_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -135,7 +135,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_last_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -156,7 +156,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_first_not_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -168,7 +168,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_first_not_of(_CharT __c, size_type __pos) const noexcept
+ {
+@@ -179,7 +179,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_last_not_of(const _CharT* __str, size_type __pos, size_type __n) const
+ {
+@@ -200,7 +200,7 @@
+ }
+
+ template<typename _CharT, typename _Traits>
+- typename basic_string_view<_CharT, _Traits>::size_type
++ constexpr typename basic_string_view<_CharT, _Traits>::size_type
+ basic_string_view<_CharT, _Traits>::
+ find_last_not_of(_CharT __c, size_type __pos) const noexcept
+ {
+Index: libstdc++-v3/libsupc++/cxxabi.h
+===================================================================
+--- a/src/libstdc++-v3/libsupc++/cxxabi.h (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/libsupc++/cxxabi.h (.../branches/gcc-7-branch)
+@@ -182,7 +182,7 @@
+ * with GNU extensions. For example, this function is used in
+ * __gnu_cxx::__verbose_terminate_handler.
+ *
+- * See http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch39.html
++ * See https://gcc.gnu.org/onlinedocs/libstdc++/manual/ext_demangling.html
+ * for other examples of use.
+ *
+ * @note The same demangling functionality is available via
Index: libstdc++-v3/ChangeLog
===================================================================
--- a/src/libstdc++-v3/ChangeLog (.../tags/gcc_7_2_0_release)
+++ b/src/libstdc++-v3/ChangeLog (.../branches/gcc-7-branch)
-@@ -1,3 +1,95 @@
+@@ -1,3 +1,247 @@
++2017-09-13 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline
++ 2017-09-04 Daniel Kruegler <daniel.kruegler at gmail.com>
++
++ PR libstdc++/79162
++ Implement LWG 2946, LWG 2758's resolution missed further corrections
++ * include/bits/basic_string.h (basic_string::compare): Add missing
++ required noexcept specifications.
++ (basic_string): Introduce internal _S_to_string_view and __sv_wrapper
++ for implicit string_view conversion.
++ (basic_string::basic_string): Fix explicit string_view conversion by
++ implicit conversion using _S_to_string_view and __sv_wrapper.
++ (basic_string): Introduce internal basic_string(__sv_wrapper, Alloc)
++ constructor.
++ (basic_string): Fix operator=(T) template by operator=(const T&)
++ template for uncopyable types (PR 79162).
++ (basic_string::operator+=, basic_string::append, basic_string::assign)
++ (basic_string::insert, basic_string::replace, basic_string::find)
++ (basic_string::rfind, basic_string::find_first_of)
++ (basic_string::find_last_of, basic_string::find_first_not_of)
++ (basic_string::find_last_not_of, basic_string::compare): Replace
++ __sv_type argument by template const T& (LWG 2946) and correct
++ documentation describing __sv_type argument.
++ (basic_string::find, basic_string::rfind, basic_string::find_first_of)
++ (basic_string::find_last_of, basic_string::find_first_not_of)
++ (basic_string::find_last_not_of, basic_string::compare): Replace
++ unconditional noexcept specification by conditional noexcept
++ specification to partially balance the removal of noexcept by LWG 2946.
++ * testsuite/21_strings/basic_string/79162.cc: New.
++ * testsuite/21_strings/basic_string/lwg2946.cc: New.
++
++2017-09-13 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/81468
++ * include/std/chrono (time_point(const time_point<_Dur2>&)): Add
++ missing constraint from LWG DR 1177.
++ * testsuite/20_util/duration/cons/dr1177.cc: New.
++ * testsuite/20_util/time_point/cons/81468.cc: New.
++ * testsuite/20_util/duration/literals/range.cc: Update dg-error line.
++
++ * doc/doxygen/mainpage.html: Fix broken URLs.
++
++ PR libstdc++/81835
++ * doc/xml/manual/extensions.xml: Replace unstable URL.
++ * doc/html/manual/ext_demangling.html: Regenerate.
++ * libsupc++/cxxabi.h (__cxa_demangle): Fix broken URL.
++
++2017-09-12 Jonathan Wakely <jwakely at redhat.com>
++
++ Backport from mainline
++ 2017-09-12 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/70483
++ * include/experimental/bits/string_view.tcc (basic_string_view::find)
++ (basic_string_view::rfind, basic_string_view::find_first_of)
++ (basic_string_view::find_last_of, basic_string_view::find_first_not_of)
++ (basic_string_view::find_last_not_of): Add constexpr specifier.
++ * include/experimental/string_view (basic_string_view::remove_prefix)
++ (basic_string_view::remove_suffix, basic_string_view::swap)
++ (basic_string_view::compare, basic_string_view::find)
++ (basic_string_view::rfind, basic_string_view::find_first_of)
++ (basic_string_view::find_last_of, basic_string_view::find_first_not_of)
++ (basic_string_view::find_last_not_of, operator==, operator!=)
++ (operator<, operator>, operator<=, operator>=): Likewise.
++ * testsuite/experimental/string_view/operations/compare/char/70483.cc:
++ New.
++
++ Backport from mainline
++ 2017-09-11 Jonathan Wakely <jwakely at redhat.com>
++
++ PR libstdc++/70483
++ * include/bits/string_view.tcc (basic_string_view::find)
++ (basic_string_view::rfind, basic_string_view::find_first_of)
++ (basic_string_view::find_last_of, basic_string_view::find_first_not_of)
++ (basic_string_view::find_last_not_of): Add constexpr specifier.
++ * include/std/string_view (basic_string_view::operator=)
++ (basic_string_view::rbegin, basic_string_view::rend)
++ (basic_string_view::crbegin, basic_string_view::crend)
++ (basic_string_view::remove_prefix, basic_string_view::remove_suffix)
++ (basic_string_view::swap, basic_string_view::compare)
++ (basic_string_view::find, basic_string_view::rfind)
++ (basic_string_view::find_first_of, basic_string_view::find_last_of)
++ (basic_string_view::find_first_not_of)
++ (basic_string_view::find_last_not_of, basic_string_view::_M_check)
++ (basic_string_view::_M_limit, operator==, operator!=, operator<)
++ (operator>, operator<=, operator>=): Likewise.
++ * testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
++ char/1.cc: Repeat tests in constexpr context.
++ * testsuite/21_strings/basic_string_view/modifiers/remove_prefix/
++ wchar_t/1.cc: Likewise.
++ * testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
++ char/1.cc: Likewise.
++ * testsuite/21_strings/basic_string_view/modifiers/remove_suffix/
++ wchar_t/1.cc: Likewise.
++ * testsuite/21_strings/basic_string_view/operations/find/char/1.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operations/find/char/2.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operations/find/char/3.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operators/char/2.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/range_access/char/1.cc: Test
++ cbegin, cend, rbegin, rend, crbegin and crend.
++ * testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc:
++ Likewise.
++ * testsuite/21_strings/basic_string_view/operations/compare/char/1.cc:
++ Remove trailing whitespace.
++ * testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
++ 1.cc: Likewise.
++ * testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc:
++ New.
++ * testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc:
++ New.
++ * testsuite/21_strings/basic_string_view/operations/compare/char/2.cc:
++ New.
++ * testsuite/21_strings/basic_string_view/operations/compare/wchar_t/
++ 2.cc: New.
++
++ Backport from mainline
++ 2017-06-12 Pedro Alves <palves at redhat.com>
++
++ * doc/xml/manual/status_cxx2017.xml: Update C++17 constexpr
++ char_traits status.
++ * doc/html/*: Regenerate.
++
++ * include/bits/char_traits.h (_GLIBCXX_ALWAYS_INLINE): Define if
++ not already defined.
++ (__cpp_lib_constexpr_char_traits): Uncomment.
++ (__constant_string_p, __constant_char_array_p): New.
++ (std::char_traits<char>, std::char_traits<wchar_t>): Add
++ _GLIBCXX17_CONSTEXPR on compare, length and find and use
++ __constant_string_p, __constant_char_array_p and
++ __builtin_constant_p to defer to __gnu_cxx::char_traits at compile
++ time.
++
++ * testsuite/21_strings/char_traits/requirements/
++ constexpr_functions_c++17.cc: Uncomment
++ __cpp_lib_constexpr_char_traits tests. Uncomment
++ test_compare<char>, test_length<char>, test_find<char>,
++ test_compare<wchar_t>, test_length<wchar_t> and test_find<wchar_t>
++ static_assert tests.
++
+2017-09-04 Jonathan Wakely <jwakely at redhat.com>
+
+ Backport from mainline
@@ -1020,6 +3332,1713 @@ Index: libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/53984.cc
+{
+ test01();
+}
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/wchar_t/1.cc (.../branches/gcc-7-branch)
+@@ -33,10 +33,29 @@
+ VERIFY( str0 == wstring_view{L"olympus mo"} );
+ }
+
++constexpr bool
++test02()
++{
++ using std::wstring_view;
++
++ wstring_view str0{L"olympus mons"};
++ wstring_view::pointer p = str0.data();
++ str0.remove_suffix(2);
++ if ( str0.data() != p)
++ return false;
++ if ( str0.length() != 10 )
++ return false;
++ if ( str0 != wstring_view{L"olympus mo"} )
++ return false;
++
++ return true;
++}
++
+ int
+ main()
+ {
+ test01();
++ static_assert( test02() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_suffix/char/1.cc (.../branches/gcc-7-branch)
+@@ -33,10 +33,29 @@
+ VERIFY( str0 == string_view{"olympus mo"} );
+ }
+
++constexpr bool
++test02()
++{
++ using std::string_view;
++
++ string_view str0{"olympus mons"};
++ string_view::pointer p = str0.data();
++ str0.remove_suffix(2);
++ if ( str0.data() != p)
++ return false;
++ if ( str0.length() != 10 )
++ return false;
++ if ( str0 != string_view{"olympus mo"} )
++ return false;
++
++ return true;
++}
++
+ int
+ main()
+ {
+ test01();
++ static_assert( test02() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/wchar_t/1.cc (.../branches/gcc-7-branch)
+@@ -33,10 +33,29 @@
+ VERIFY( str0 == wstring_view{L"pus mons"} );
+ }
+
++constexpr bool
++test02()
++{
++ using std::wstring_view;
++
++ wstring_view str0{L"olympus mons"};
++ wstring_view::pointer p = str0.data();
++ str0.remove_prefix(4);
++ if ( str0.data() != p + 4)
++ return false;
++ if ( str0.length() != 8 )
++ return false;
++ if ( str0 != wstring_view{L"pus mons"} )
++ return false;
++
++ return true;
++}
++
+ int
+ main()
+ {
+ test01();
++ static_assert( test02() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/remove_prefix/char/1.cc (.../branches/gcc-7-branch)
+@@ -33,10 +33,29 @@
+ VERIFY( str0 == string_view{"pus mons"} );
+ }
+
++constexpr bool
++test02()
++{
++ using std::string_view;
++
++ string_view str0{"olympus mons"};
++ string_view::pointer p = str0.data();
++ str0.remove_prefix(4);
++ if ( str0.data() != p + 4)
++ return false;
++ if ( str0.length() != 8 )
++ return false;
++ if ( str0 != string_view{"pus mons"} )
++ return false;
++
++ return true;
++}
++
+ int
+ main()
+ {
+ test01();
++ static_assert( test02() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,35 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-options "-std=gnu++17" }
++// { dg-do compile { target c++1z } }
++
++#include <string_view>
++
++constexpr bool
++test01()
++{
++ using std::wstring_view;
++
++ wstring_view s1{L"last"};
++ wstring_view s2{L"first"};
++
++ s1.swap(s2);
++ return s1 == L"first" && s2 == L"last";
++}
++
++static_assert( test01() );
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,35 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-options "-std=gnu++17" }
++// { dg-do compile { target c++1z } }
++
++#include <string_view>
++
++constexpr bool
++test01()
++{
++ using std::string_view;
++
++ string_view s1{"last"};
++ string_view s2{"first"};
++
++ s1.swap(s2);
++ return s1 == "first" && s2 == "last";
++}
++
++static_assert( test01() );
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/1.cc (.../branches/gcc-7-branch)
+@@ -61,10 +61,10 @@
+ csz01 = str01.find(str04, 5);
+ VERIFY( csz01 == 5 );
+ csz01 = str01.find(str04, str01.size());
+- VERIFY( csz01 == str01.size() );
++ VERIFY( csz01 == str01.size() );
+ csz01 = str01.find(str04, str01.size()+1);
+- VERIFY( csz01 == npos );
+-
++ VERIFY( csz01 == npos );
++
+ // size_type find(const wchar_t* s, size_type pos, size_type n) const;
+ csz01 = str01.find(str_lit01, 0, 3);
+ VERIFY( csz01 == 0 );
+@@ -85,10 +85,79 @@
+ VERIFY( csz01 == npos );
+ }
+
++constexpr bool
++test02()
++{
++ typedef std::wstring_view::size_type csize_type;
++ typedef std::wstring_view::const_reference cref;
++ typedef std::wstring_view::reference ref;
++ csize_type npos = std::wstring_view::npos;
++ csize_type csz01 = 0, csz02 = 0;
++
++ const wchar_t str_lit01[] = L"mave";
++ const std::wstring_view str01(L"mavericks, santa cruz");
++ std::wstring_view str02(str_lit01);
++ std::wstring_view str03(L"s, s");
++ std::wstring_view str04;
++
++#undef VERIFY
++#define VERIFY(x) if(!(x)) return false
++
++ // size_type find(const wstring_view&, size_type pos = 0) const;
++ csz01 = str01.find(str01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str01, 4);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find(str02, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str02, 3);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find(str03, 0);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find(str03, 3);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find(str03, 12);
++ VERIFY( csz01 == npos );
++
++ // An empty string_view consists of no characters
++ // therefore it should be found at every point in a string_view,
++ // except beyond the end
++ csz01 = str01.find(str04, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str04, 5);
++ VERIFY( csz01 == 5 );
++ csz01 = str01.find(str04, str01.size());
++ VERIFY( csz01 == str01.size() );
++ csz01 = str01.find(str04, str01.size()+1);
++ VERIFY( csz01 == npos );
++
++ // size_type find(const wchar_t* s, size_type pos, size_type n) const;
++ csz01 = str01.find(str_lit01, 0, 3);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str_lit01, 3, 0);
++ VERIFY( csz01 == 3 );
++
++ // size_type find(const wchar_t* s, size_type pos = 0) const;
++ csz01 = str01.find(str_lit01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str_lit01, 3);
++ VERIFY( csz01 == npos );
++
++ // size_type find(wchar_t c, size_type pos = 0) const;
++ csz01 = str01.find(L'z');
++ csz02 = str01.size() - 1;
++ VERIFY( csz01 == csz02 );
++ csz01 = str01.find(L'/');
++ VERIFY( csz01 == npos );
++
++ return true;
++}
++
+ int
+ main()
+-{
++{
+ test01();
++ static_assert( test02() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/2.cc (.../branches/gcc-7-branch)
+@@ -59,13 +59,13 @@
+ // An empty string_view consists of no characters
+ // therefore it should be found at every point in a string_view,
+ // except beyond the end
+- // However, str1.find_first_of(str2,pos) finds the first character in
++ // However, str1.find_first_of(str2,pos) finds the first character in
+ // str1 (starting at pos) that exists in str2, which is none for empty str2
+ csz01 = str01.find_first_of(str04, 0);
+ VERIFY( csz01 == npos );
+ csz01 = str01.find_first_of(str04, 5);
+ VERIFY( csz01 == npos );
+-
++
+ // size_type find_first_of(const wchar_t* s, size_type pos, size_type n) const;
+ csz01 = str01.find_first_of(str_lit01, 0, 3);
+ VERIFY( csz01 == 0 );
+@@ -84,10 +84,78 @@
+ VERIFY( csz01 == csz02 );
+ }
+
++constexpr bool
++test04()
++{
++ typedef std::wstring_view::size_type csize_type;
++ csize_type npos = std::wstring_view::npos;
++ csize_type csz01 = 0, csz02 = 0;
++
++ const wchar_t str_lit01[] = L"mave";
++ const std::wstring_view str01(L"mavericks, santa cruz");
++ std::wstring_view str02(str_lit01);
++ std::wstring_view str03(L"s, s");
++ std::wstring_view str04;
++
++#undef VERIFY
++#define VERIFY(x) if(!(x)) return false
++
++ // size_type find_first_of(const wstring_view&, size_type pos = 0) const;
++ std::wstring_view str05(L"xena rulez");
++ csz01 = str01.find_first_of(str01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str01, 4);
++ VERIFY( csz01 == 4 );
++ csz01 = str01.find_first_of(str02, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str02, 3);
++ VERIFY( csz01 == 3 );
++ csz01 = str01.find_first_of(str03, 0);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_of(str03, 3);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_of(str03, 12);
++ VERIFY( csz01 == 16 );
++ csz01 = str01.find_first_of(str05, 0);
++ VERIFY( csz01 == 1 );
++ csz01 = str01.find_first_of(str05, 4);
++ VERIFY( csz01 == 4 );
++
++ // An empty string_view consists of no characters
++ // therefore it should be found at every point in a string_view,
++ // except beyond the end
++ // However, str1.find_first_of(str2,pos) finds the first character in
++ // str1 (starting at pos) that exists in str2, which is none for empty str2
++ csz01 = str01.find_first_of(str04, 0);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find_first_of(str04, 5);
++ VERIFY( csz01 == npos );
++
++ // size_type find_first_of(const wchar_t* s, size_type pos, size_type n) const;
++ csz01 = str01.find_first_of(str_lit01, 0, 3);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str_lit01, 3, 0);
++ VERIFY( csz01 == npos );
++
++ // size_type find_first_of(const wchar_t* s, size_type pos = 0) const;
++ csz01 = str01.find_first_of(str_lit01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str_lit01, 3);
++ VERIFY( csz01 == 3 );
++
++ // size_type find_first_of(wchar_t c, size_type pos = 0) const;
++ csz01 = str01.find_first_of(L'z');
++ csz02 = str01.size() - 1;
++ VERIFY( csz01 == csz02 );
++
++ return true;
++}
++
+ int
+ main()
+-{
++{
+ test02();
++ static_assert( test04() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/wchar_t/3.cc (.../branches/gcc-7-branch)
+@@ -84,10 +84,78 @@
+ VERIFY( csz01 == npos );
+ }
+
++constexpr bool
++test04()
++{
++ typedef std::wstring_view::size_type csize_type;
++ csize_type npos = std::wstring_view::npos;
++ csize_type csz01 = 0;
++
++ const std::wstring_view str01(L"Bob Rock, per me");
++ const wchar_t str_lit01[] = L"Bob Rock";
++ std::wstring_view str02(L"ovvero Trivi");
++ std::wstring_view str03(str_lit01);
++ std::wstring_view str04;
++
++#undef VERIFY
++#define VERIFY(x) if(!(x)) return false
++
++ // size_type find_first_not_of(const string_view&, size_type pos = 0) const;
++ csz01 = str01.find_first_not_of(str01);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find_first_not_of(str02, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_not_of(str02, 10);
++ VERIFY( csz01 == 10 );
++ csz01 = str01.find_first_not_of(str02, 12);
++ VERIFY( csz01 == 14 );
++ csz01 = str01.find_first_not_of(str03, 0);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_not_of(str03, 15);
++ VERIFY( csz01 == 15 );
++ csz01 = str01.find_first_not_of(str03, 16);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find_first_not_of(str04, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_not_of(str04, 12);
++ VERIFY( csz01 == 12 );
++ csz01 = str03.find_first_not_of(str01, 0);
++ VERIFY( csz01 == npos );
++ csz01 = str04.find_first_not_of(str02, 0);
++ VERIFY( csz01 == npos );
++
++ // size_type find_first_not_of(const char* s, size_type pos, size_type n) const;
++ csz01 = str01.find_first_not_of(str_lit01, 0, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_not_of(str_lit01, 0, 8);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_not_of(str_lit01, 10, 0);
++ VERIFY( csz01 == 10 );
++
++ // size_type find_first_not_of(const char* s, size_type pos = 0) const;
++ csz01 = str01.find_first_not_of(str_lit01);
++ VERIFY( csz01 == 8 );
++ csz01 = str02.find_first_not_of(str_lit01, 2);
++ VERIFY( csz01 == 2 );
++
++ // size_type find_first_not_of(char c, size_type pos = 0) const;
++ csz01 = str01.find_first_not_of(L'B');
++ VERIFY( csz01 == 1 );
++ csz01 = str01.find_first_not_of(L'o', 1);
++ VERIFY( csz01 == 2 );
++ csz01 = str02.find_first_not_of(L'z');
++ VERIFY( csz01 == 0 );
++ csz01 = str04.find_first_not_of(L'S');
++ VERIFY( csz01 == npos );
++
++ return true;
++}
++
+ int
+ main()
+-{
++{
+ test03();
++ static_assert( test04() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/1.cc (.../branches/gcc-7-branch)
+@@ -61,10 +61,10 @@
+ csz01 = str01.find(str04, 5);
+ VERIFY( csz01 == 5 );
+ csz01 = str01.find(str04, str01.size());
+- VERIFY( csz01 == str01.size() );
++ VERIFY( csz01 == str01.size() );
+ csz01 = str01.find(str04, str01.size()+1);
+- VERIFY( csz01 == npos );
+-
++ VERIFY( csz01 == npos );
++
+ // size_type find(const char* s, size_type pos, size_type n) const;
+ csz01 = str01.find(str_lit01, 0, 3);
+ VERIFY( csz01 == 0 );
+@@ -85,10 +85,80 @@
+ VERIFY( csz01 == npos );
+ }
+
++constexpr bool
++test02()
++{
++ typedef std::string_view::size_type csize_type;
++ typedef std::string_view::const_reference cref;
++ typedef std::string_view::reference ref;
++ csize_type npos = std::string_view::npos;
++ csize_type csz01 = 0, csz02 = 0;
++
++ const char str_lit01[] = "mave";
++ const std::string_view str01("mavericks, santa cruz");
++ std::string_view str02(str_lit01);
++ std::string_view str03("s, s");
++ std::string_view str04;
++
++#undef VERIFY
++#define VERIFY(x) if(!(x)) return false
++
++ // size_type find(const string_view&, size_type pos = 0) const;
++ csz01 = str01.find(str01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str01, 4);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find(str02, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str02, 3);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find(str03, 0);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find(str03, 3);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find(str03, 12);
++ VERIFY( csz01 == npos );
++
++ // An empty string_view consists of no characters
++ // therefore it should be found at every point in a string_view,
++ // except beyond the end
++ csz01 = str01.find(str04, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str04, 5);
++ VERIFY( csz01 == 5 );
++ csz01 = str01.find(str04, str01.size());
++ VERIFY( csz01 == str01.size() );
++ csz01 = str01.find(str04, str01.size()+1);
++ VERIFY( csz01 == npos );
++
++ // size_type find(const char* s, size_type pos, size_type n) const;
++ csz01 = str01.find(str_lit01, 0, 3);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str_lit01, 3, 0);
++ VERIFY( csz01 == 3 );
++
++ // size_type find(const char* s, size_type pos = 0) const;
++ csz01 = str01.find(str_lit01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find(str_lit01, 3);
++ VERIFY( csz01 == npos );
++
++ // size_type find(char c, size_type pos = 0) const;
++ csz01 = str01.find('z');
++ csz02 = str01.size() - 1;
++ VERIFY( csz01 == csz02 );
++ csz01 = str01.find('/');
++ VERIFY( csz01 == npos );
++
++ return true;
++}
++
++
+ int
+ main()
+-{
++{
+ test01();
++ static_assert( test02() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/2.cc (.../branches/gcc-7-branch)
+@@ -59,13 +59,13 @@
+ // An empty string_view consists of no characters
+ // therefore it should be found at every point in a string_view,
+ // except beyond the end
+- // However, str1.find_first_of(str2,pos) finds the first character in
++ // However, str1.find_first_of(str2,pos) finds the first character in
+ // str1 (starting at pos) that exists in str2, which is none for empty str2
+ csz01 = str01.find_first_of(str04, 0);
+ VERIFY( csz01 == npos );
+ csz01 = str01.find_first_of(str04, 5);
+ VERIFY( csz01 == npos );
+-
++
+ // size_type find_first_of(const char* s, size_type pos, size_type n) const;
+ csz01 = str01.find_first_of(str_lit01, 0, 3);
+ VERIFY( csz01 == 0 );
+@@ -84,10 +84,78 @@
+ VERIFY( csz01 == csz02 );
+ }
+
++constexpr bool
++test03()
++{
++ typedef std::string_view::size_type csize_type;
++ csize_type npos = std::string_view::npos;
++ csize_type csz01 = 0, csz02 = 0;
++
++ const char str_lit01[] = "mave";
++ const std::string_view str01("mavericks, santa cruz");
++ std::string_view str02(str_lit01);
++ std::string_view str03("s, s");
++ std::string_view str04;
++
++#undef VERIFY
++#define VERIFY(x) if(!(x)) return false
++
++ // size_type find_first_of(const string_view&, size_type pos = 0) const;
++ std::string_view str05("xena rulez");
++ csz01 = str01.find_first_of(str01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str01, 4);
++ VERIFY( csz01 == 4 );
++ csz01 = str01.find_first_of(str02, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str02, 3);
++ VERIFY( csz01 == 3 );
++ csz01 = str01.find_first_of(str03, 0);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_of(str03, 3);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_of(str03, 12);
++ VERIFY( csz01 == 16 );
++ csz01 = str01.find_first_of(str05, 0);
++ VERIFY( csz01 == 1 );
++ csz01 = str01.find_first_of(str05, 4);
++ VERIFY( csz01 == 4 );
++
++ // An empty string_view consists of no characters
++ // therefore it should be found at every point in a string_view,
++ // except beyond the end
++ // However, str1.find_first_of(str2,pos) finds the first character in
++ // str1 (starting at pos) that exists in str2, which is none for empty str2
++ csz01 = str01.find_first_of(str04, 0);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find_first_of(str04, 5);
++ VERIFY( csz01 == npos );
++
++ // size_type find_first_of(const char* s, size_type pos, size_type n) const;
++ csz01 = str01.find_first_of(str_lit01, 0, 3);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str_lit01, 3, 0);
++ VERIFY( csz01 == npos );
++
++ // size_type find_first_of(const char* s, size_type pos = 0) const;
++ csz01 = str01.find_first_of(str_lit01);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_of(str_lit01, 3);
++ VERIFY( csz01 == 3 );
++
++ // size_type find_first_of(char c, size_type pos = 0) const;
++ csz01 = str01.find_first_of('z');
++ csz02 = str01.size() - 1;
++ VERIFY( csz01 == csz02 );
++
++ return true;
++}
++
+ int
+ main()
+-{
++{
+ test02();
++ static_assert( test03() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/find/char/3.cc (.../branches/gcc-7-branch)
+@@ -84,10 +84,78 @@
+ VERIFY( csz01 == npos );
+ }
+
++constexpr bool
++test04()
++{
++ typedef std::string_view::size_type csize_type;
++ csize_type npos = std::string_view::npos;
++ csize_type csz01 = 0;
++
++ const std::string_view str01("Bob Rock, per me");
++ const char str_lit01[] = "Bob Rock";
++ std::string_view str02("ovvero Trivi");
++ std::string_view str03(str_lit01);
++ std::string_view str04;
++
++#undef VERIFY
++#define VERIFY(x) if(!(x)) return false
++
++ // size_type find_first_not_of(const string_view&, size_type pos = 0) const;
++ csz01 = str01.find_first_not_of(str01);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find_first_not_of(str02, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_not_of(str02, 10);
++ VERIFY( csz01 == 10 );
++ csz01 = str01.find_first_not_of(str02, 12);
++ VERIFY( csz01 == 14 );
++ csz01 = str01.find_first_not_of(str03, 0);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_not_of(str03, 15);
++ VERIFY( csz01 == 15 );
++ csz01 = str01.find_first_not_of(str03, 16);
++ VERIFY( csz01 == npos );
++ csz01 = str01.find_first_not_of(str04, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_not_of(str04, 12);
++ VERIFY( csz01 == 12 );
++ csz01 = str03.find_first_not_of(str01, 0);
++ VERIFY( csz01 == npos );
++ csz01 = str04.find_first_not_of(str02, 0);
++ VERIFY( csz01 == npos );
++
++ // size_type find_first_not_of(const char* s, size_type pos, size_type n) const;
++ csz01 = str01.find_first_not_of(str_lit01, 0, 0);
++ VERIFY( csz01 == 0 );
++ csz01 = str01.find_first_not_of(str_lit01, 0, 8);
++ VERIFY( csz01 == 8 );
++ csz01 = str01.find_first_not_of(str_lit01, 10, 0);
++ VERIFY( csz01 == 10 );
++
++ // size_type find_first_not_of(const char* s, size_type pos = 0) const;
++ csz01 = str01.find_first_not_of(str_lit01);
++ VERIFY( csz01 == 8 );
++ csz01 = str02.find_first_not_of(str_lit01, 2);
++ VERIFY( csz01 == 2 );
++
++ // size_type find_first_not_of(char c, size_type pos = 0) const;
++ csz01 = str01.find_first_not_of('B');
++ VERIFY( csz01 == 1 );
++ csz01 = str01.find_first_not_of('o', 1);
++ VERIFY( csz01 == 2 );
++ csz01 = str02.find_first_not_of('z');
++ VERIFY( csz01 == 0 );
++ csz01 = str04.find_first_not_of('S');
++ VERIFY( csz01 == npos );
++
++ return true;
++}
++
+ int
+ main()
+-{
++{
+ test03();
++ static_assert( test04() );
+
+ return 0;
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/1.cc (.../branches/gcc-7-branch)
+@@ -62,9 +62,9 @@
+ VERIFY(pass);
+ return 0;
+ }
+-
+
+-int
++
++int
+ test01()
+ {
+ using std::wstring_view;
+@@ -74,7 +74,7 @@
+ wstring_view str_2;
+
+ //sanity check
+- test_value(wcscmp(L"costa marbella", L"costa rica"), lt);
++ test_value(wcscmp(L"costa marbella", L"costa rica"), lt);
+ test_value(wcscmp(L"costa rica", L"costa rica"), z);
+ test_value(wcscmp(str_1.data(), str_0.data()), lt);
+ test_value(wcscmp(str_0.data(), str_1.data()), gt);
+@@ -100,8 +100,8 @@
+ test_value(str_1.compare(0, 4, str_2), z);
+ test_value(str_1.compare(0, 5, str_2), gt);
+
+- // int compare(size_type pos1, size_type n1, const basic_string_view& str,
+- // size_type pos2, size_type n2) const;
++ // int compare(size_type pos1, size_type n1, const basic_string_view& str,
++ // size_type pos2, size_type n2) const;
+ test_value(str_1.compare(0, 6, str_0, 0, 6), z);
+ test_value(str_1.compare(0, 7, str_0, 0, 7), lt);
+ test_value(str_0.compare(0, 7, str_1, 0, 7), gt);
+@@ -111,21 +111,21 @@
+ test_value(str_1.compare(L"costa rica"), lt);
+ str_2 = str_0;
+ test_value(str_2.compare(L"costa rica"), z);
+- test_value(str_2.compare(L"cost"), gt);
+- test_value(str_2.compare(L"costa ricans"), lt);
++ test_value(str_2.compare(L"cost"), gt);
++ test_value(str_2.compare(L"costa ricans"), lt);
+
+ // int compare(size_type pos, size_type n1, const charT* str,
+ // size_type n2 = npos) const;
+- test_value(str_1.compare(0, 6, L"costa rica", 0, 6), z);
+- test_value(str_1.compare(0, 7, L"costa rica", 0, 7), lt);
+- test_value(str_0.compare(0, 7, L"costa marbella", 0, 7), gt);
++ test_value(str_1.compare(0, 6, L"costa rica", 0, 6), z);
++ test_value(str_1.compare(0, 7, L"costa rica", 0, 7), lt);
++ test_value(str_0.compare(0, 7, L"costa marbella", 0, 7), gt);
+
+ return 0;
+ }
+
+
+-int
+-main()
++int
++main()
+ {
+ test01();
+
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,30 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-options "-std=gnu++17" }
++// { dg-do compile { target c++1z } }
++
++#include <string_view>
++
++constexpr wchar_t c1[] = L"one";
++constexpr wchar_t c2[] = L"two";
++
++constexpr std::wstring_view s1{c1};
++constexpr std::wstring_view s2{c2};
++
++constexpr int n1 = s1.compare(s1);
++constexpr int n2 = s1.compare(s2);
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/1.cc (.../branches/gcc-7-branch)
+@@ -62,9 +62,8 @@
+ VERIFY(pass);
+ return 0;
+ }
+-
+
+-int
++int
+ test01()
+ {
+ using std::string_view;
+@@ -74,7 +73,7 @@
+ string_view str_2;
+
+ //sanity check
+- test_value(strcmp("costa marbella", "costa rica"), lt);
++ test_value(strcmp("costa marbella", "costa rica"), lt);
+ test_value(strcmp("costa rica", "costa rica"), z);
+ test_value(strcmp(str_1.data(), str_0.data()), lt);
+ test_value(strcmp(str_0.data(), str_1.data()), gt);
+@@ -100,8 +99,8 @@
+ test_value(str_1.compare(0, 4, str_2), z);
+ test_value(str_1.compare(0, 5, str_2), gt);
+
+- // int compare(size_type pos1, size_type n1, const basic_string_view& str,
+- // size_type pos2, size_type n2) const;
++ // int compare(size_type pos1, size_type n1, const basic_string_view& str,
++ // size_type pos2, size_type n2) const;
+ test_value(str_1.compare(0, 6, str_0, 0, 6), z);
+ test_value(str_1.compare(0, 7, str_0, 0, 7), lt);
+ test_value(str_0.compare(0, 7, str_1, 0, 7), gt);
+@@ -111,21 +110,21 @@
+ test_value(str_1.compare("costa rica"), lt);
+ str_2 = str_0;
+ test_value(str_2.compare("costa rica"), z);
+- test_value(str_2.compare("cost"), gt);
+- test_value(str_2.compare("costa ricans"), lt);
++ test_value(str_2.compare("cost"), gt);
++ test_value(str_2.compare("costa ricans"), lt);
+
+ // int compare(size_type pos, size_type n1, const charT* str,
+ // size_type n2 = npos) const;
+- test_value(str_1.compare(0, 6, "costa rica", 0, 6), z);
+- test_value(str_1.compare(0, 7, "costa rica", 0, 7), lt);
+- test_value(str_0.compare(0, 7, "costa marbella", 0, 7), gt);
++ test_value(str_1.compare(0, 6, "costa rica", 0, 6), z);
++ test_value(str_1.compare(0, 7, "costa rica", 0, 7), lt);
++ test_value(str_0.compare(0, 7, "costa marbella", 0, 7), gt);
+
+ return 0;
+ }
+
+
+-int
+-main()
++int
++main()
+ {
+ test01();
+
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/2.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/2.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,30 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-options "-std=gnu++17" }
++// { dg-do compile { target c++1z } }
++
++#include <string_view>
++
++constexpr char c1[] = "one";
++constexpr char c2[] = "two";
++
++constexpr std::string_view s1{c1};
++constexpr std::string_view s2{c2};
++
++constexpr int n1 = s1.compare(s1);
++constexpr int n2 = s1.compare(s2);
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,89 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-options "-std=gnu++17" }
++// { dg-do compile { target c++1z } }
++
++#include <string_view>
++
++struct constexpr_char_traits : std::char_traits<char>
++{
++ static constexpr size_t
++ length(const char* val)
++ {
++ size_t res = 0;
++ for (; val[res] != '\0'; ++res)
++ ;
++ return res;
++ }
++
++ static constexpr int
++ compare(const char* lhs, const char* rhs, std::size_t count)
++ {
++ for (size_t pos = 0; pos < count; ++pos)
++ {
++ if (lhs[pos] != rhs[pos])
++ return lhs[pos] - rhs[pos];
++ }
++ return 0;
++ }
++};
++
++using string_view = std::basic_string_view<char, constexpr_char_traits>;
++
++constexpr
++string_view get()
++{
++ string_view res = "x::";
++ string_view start_pattern = "x";
++ res = res.substr(res.find(start_pattern) + start_pattern.size());
++ res = res.substr(0, res.find_first_of(";]"));
++ res = res.substr(res.rfind("::"));
++ return res;
++}
++
++static_assert( get() == get() );
++
++using std::u16string_view;
++
++constexpr
++u16string_view get16()
++{
++ u16string_view res = u"x::";
++ u16string_view start_pattern = u"x";
++ res = res.substr(res.find(start_pattern) + start_pattern.size());
++ res = res.substr(0, res.find_first_of(u";]"));
++ res = res.substr(res.rfind(u"::"));
++ return res;
++}
++
++static_assert( get16() == get16() );
++
++using std::u32string_view;
++
++constexpr
++u32string_view get32()
++{
++ u32string_view res = U"x::";
++ u32string_view start_pattern = U"x";
++ res = res.substr(res.find(start_pattern) + start_pattern.size());
++ res = res.substr(0, res.find_first_of(U";]"));
++ res = res.substr(res.rfind(U"::"));
++ return res;
++}
++
++static_assert( get32() == get32() );
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/wchar_t/1.cc (.../branches/gcc-7-branch)
+@@ -18,7 +18,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// 24.6.5, range access [iterator.range]
++// C++17 27.7, range access [iterator.range]
+
+ #include <string_view>
+
+@@ -25,9 +25,23 @@
+ void
+ test01()
+ {
+-#ifdef _GLIBCXX_USE_WCHAR_T
+ std::wstring_view ws(L"Hello, World!");
+ std::begin(ws);
+ std::end(ws);
+-#endif
++ std::rbegin(ws);
++ std::rend(ws);
+ }
++
++void
++test02()
++{
++ constexpr std::wstring_view ws(L"Hello, World!");
++ [[maybe_unused]] constexpr auto b = std::begin(ws);
++ [[maybe_unused]] constexpr auto e = std::end(ws);
++ [[maybe_unused]] constexpr auto cb = std::cbegin(ws);
++ [[maybe_unused]] constexpr auto ce = std::cend(ws);
++ [[maybe_unused]] constexpr auto rb = std::rbegin(ws);
++ [[maybe_unused]] constexpr auto re = std::rend(ws);
++ [[maybe_unused]] constexpr auto crb = std::crbegin(ws);
++ [[maybe_unused]] constexpr auto cre = std::crend(ws);
++}
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/range_access/char/1.cc (.../branches/gcc-7-branch)
+@@ -18,7 +18,7 @@
+ // with this library; see the file COPYING3. If not see
+ // <http://www.gnu.org/licenses/>.
+
+-// 24.6.5, range access [iterator.range]
++// C++17 27.7, range access [iterator.range]
+
+ #include <string_view>
+
+@@ -28,4 +28,20 @@
+ std::string_view s("Hello, World!");
+ std::begin(s);
+ std::end(s);
++ std::rbegin(s);
++ std::rend(s);
+ }
++
++void
++test02()
++{
++ constexpr std::string_view s("Hello, World!");
++ [[maybe_unused]] constexpr auto b = std::begin(s);
++ [[maybe_unused]] constexpr auto e = std::end(s);
++ [[maybe_unused]] constexpr auto cb = std::cbegin(s);
++ [[maybe_unused]] constexpr auto ce = std::cend(s);
++ [[maybe_unused]] constexpr auto rb = std::rbegin(s);
++ [[maybe_unused]] constexpr auto re = std::rend(s);
++ [[maybe_unused]] constexpr auto crb = std::crbegin(s);
++ [[maybe_unused]] constexpr auto cre = std::crend(s);
++}
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operators/wchar_t/2.cc (.../branches/gcc-7-branch)
+@@ -45,7 +45,7 @@
+ const basic_string_view<charT,traits,Allocator>& rhs);
+
+ template<class charT, class traits, class Allocator>
+- bool operator!=(const basic_string_view<charT,traits,Allocator>& lhs,
++ bool operator!=(const basic_string_view<charT,traits,Allocator>& lhs,
+ const charT* rhs);
+ */
+
+@@ -60,7 +60,7 @@
+ const charT* rhs);
+
+ template<class charT, class traits, class Allocator>
+- bool operator< (const charT* lhs,
++ bool operator< (const charT* lhs,
+ const basic_string_view<charT,traits,Allocator>& rhs);
+ */
+
+@@ -112,7 +112,7 @@
+ #include <string_view>
+ #include <testsuite_hooks.h>
+
+-int
++void
+ test01()
+ {
+ std::wstring_view str_0(L"costa rica");
+@@ -120,7 +120,7 @@
+ std::wstring_view str_2(L"cost");
+ std::wstring_view str_3(L"costa ricans");
+ std::wstring_view str_4;
+-
++
+ str_4 = str_0;
+ //comparisons between string_view objects
+ VERIFY( !(str_0 == str_1) );
+@@ -140,7 +140,7 @@
+ VERIFY( str_3 != str_0 );
+ VERIFY( !(str_0 != str_4) );
+ VERIFY( !(str_4 != str_0) );
+-
++
+ VERIFY( str_0 > str_1 ); //true cuz r>m
+ VERIFY( str_0 > str_2 );
+ VERIFY( !(str_0 > str_3) );
+@@ -231,14 +231,137 @@
+ VERIFY( !(L"costa ricans" <= str_0) );
+ VERIFY( L"costa rica" <= str_0 );
+ VERIFY( str_0 <= L"costa rica" );
++}
+
+- return 0;
++constexpr bool
++test02()
++{
++ std::wstring_view str_0(L"costa rica");
++ std::wstring_view str_1(L"costa marbella");
++ std::wstring_view str_2(L"cost");
++ std::wstring_view str_3(L"costa ricans");
++ std::wstring_view str_4;
++
++#undef VERIFY
++#define VERIFY(x) if (!(x)) return false
++
++ str_4 = str_0;
++ //comparisons between string_view objects
++ VERIFY( !(str_0 == str_1) );
++ VERIFY( !(str_0 == str_2) );
++ VERIFY( !(str_0 == str_3) );
++ VERIFY( !(str_1 == str_0) );
++ VERIFY( !(str_2 == str_0) );
++ VERIFY( !(str_3 == str_0) );
++ VERIFY( str_4 == str_0 );
++ VERIFY( str_0 == str_4 );
++
++ VERIFY( str_0 != str_1 );
++ VERIFY( str_0 != str_2 );
++ VERIFY( str_0 != str_3 );
++ VERIFY( str_1 != str_0 );
++ VERIFY( str_2 != str_0 );
++ VERIFY( str_3 != str_0 );
++ VERIFY( !(str_0 != str_4) );
++ VERIFY( !(str_4 != str_0) );
++
++ VERIFY( str_0 > str_1 ); //true cuz r>m
++ VERIFY( str_0 > str_2 );
++ VERIFY( !(str_0 > str_3) );
++ VERIFY( !(str_1 > str_0) ); //false cuz m<r
++ VERIFY( !(str_2 > str_0) );
++ VERIFY( str_3 > str_0 );
++ VERIFY( !(str_0 > str_4) );
++ VERIFY( !(str_4 > str_0) );
++
++ VERIFY( !(str_0 < str_1) ); //false cuz r>m
++ VERIFY( !(str_0 < str_2) );
++ VERIFY( str_0 < str_3 );
++ VERIFY( str_1 < str_0 ); //true cuz m<r
++ VERIFY( str_2 < str_0 );
++ VERIFY( !(str_3 < str_0) );
++ VERIFY( !(str_0 < str_4) );
++ VERIFY( !(str_4 < str_0) );
++
++ VERIFY( str_0 >= str_1 ); //true cuz r>m
++ VERIFY( str_0 >= str_2 );
++ VERIFY( !(str_0 >= str_3) );
++ VERIFY( !(str_1 >= str_0) );//false cuz m<r
++ VERIFY( !(str_2 >= str_0) );
++ VERIFY( str_3 >= str_0 );
++ VERIFY( str_0 >= str_4 );
++ VERIFY( str_4 >= str_0 );
++
++ VERIFY( !(str_0 <= str_1) );//false cuz r>m
++ VERIFY( !(str_0 <= str_2) );
++ VERIFY( str_0 <= str_3 );
++ VERIFY( str_1 <= str_0 );//true cuz m<r
++ VERIFY( str_2 <= str_0 );
++ VERIFY( !(str_3 <= str_0) );
++ VERIFY( str_0 <= str_4 );
++ VERIFY( str_4 <= str_0 );
++
++ //comparisons between string_view object and string_view literal
++ VERIFY( !(str_0 == L"costa marbella") );
++ VERIFY( !(str_0 == L"cost") );
++ VERIFY( !(str_0 == L"costa ricans") );
++ VERIFY( !(L"costa marbella" == str_0) );
++ VERIFY( !(L"cost" == str_0) );
++ VERIFY( !(L"costa ricans" == str_0) );
++ VERIFY( L"costa rica" == str_0 );
++ VERIFY( str_0 == L"costa rica" );
++
++ VERIFY( str_0 != L"costa marbella" );
++ VERIFY( str_0 != L"cost" );
++ VERIFY( str_0 != L"costa ricans" );
++ VERIFY( L"costa marbella" != str_0 );
++ VERIFY( L"cost" != str_0 );
++ VERIFY( L"costa ricans" != str_0 );
++ VERIFY( !(L"costa rica" != str_0) );
++ VERIFY( !(str_0 != L"costa rica") );
++
++ VERIFY( str_0 > L"costa marbella" ); //true cuz r>m
++ VERIFY( str_0 > L"cost" );
++ VERIFY( !(str_0 > L"costa ricans") );
++ VERIFY( !(L"costa marbella" > str_0) );//false cuz m<r
++ VERIFY( !(L"cost" > str_0) );
++ VERIFY( L"costa ricans" > str_0 );
++ VERIFY( !(L"costa rica" > str_0) );
++ VERIFY( !(str_0 > L"costa rica") );
++
++ VERIFY( !(str_0 < L"costa marbella") );//false cuz r>m
++ VERIFY( !(str_0 < L"cost") );
++ VERIFY( str_0 < L"costa ricans" );
++ VERIFY( L"costa marbella" < str_0 );//true cuz m<r
++ VERIFY( L"cost" < str_0 );
++ VERIFY( !(L"costa ricans" < str_0) );
++ VERIFY( !(L"costa rica" < str_0) );
++ VERIFY( !(str_0 < L"costa rica") );
++
++ VERIFY( str_0 >= L"costa marbella" );//true cuz r>m
++ VERIFY( str_0 >= L"cost" );
++ VERIFY( !(str_0 >= L"costa ricans") );
++ VERIFY( !(L"costa marbella" >= str_0) );//false cuz m<r
++ VERIFY( !(L"cost" >= str_0) );
++ VERIFY( L"costa ricans" >= str_0 );
++ VERIFY( L"costa rica" >= str_0 );
++ VERIFY( str_0 >= L"costa rica" );
++
++ VERIFY( !(str_0 <= L"costa marbella") );//false cuz r>m
++ VERIFY( !(str_0 <= L"cost") );
++ VERIFY( str_0 <= L"costa ricans" );
++ VERIFY( L"costa marbella" <= str_0 );//true cuz m<r
++ VERIFY( L"cost" <= str_0 );
++ VERIFY( !(L"costa ricans" <= str_0) );
++ VERIFY( L"costa rica" <= str_0 );
++ VERIFY( str_0 <= L"costa rica" );
++
++ return true;
+ }
+
+ int
+-main()
++main()
+ {
+ test01();
+-
+- return 0;
++ static_assert( test02() );
+ }
+Index: libstdc++-v3/testsuite/21_strings/basic_string_view/operators/char/2.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operators/char/2.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string_view/operators/char/2.cc (.../branches/gcc-7-branch)
+@@ -112,7 +112,7 @@
+ #include <string_view>
+ #include <testsuite_hooks.h>
+
+-int
++void
+ test01()
+ {
+ std::string_view str_0("costa rica");
+@@ -120,7 +120,7 @@
+ std::string_view str_2("cost");
+ std::string_view str_3("costa ricans");
+ std::string_view str_4;
+-
++
+ str_4 = str_0;
+ //comparisons between string objects
+ VERIFY( !(str_0 == str_1) );
+@@ -140,7 +140,7 @@
+ VERIFY( str_3 != str_0 );
+ VERIFY( !(str_0 != str_4) );
+ VERIFY( !(str_4 != str_0) );
+-
++
+ VERIFY( str_0 > str_1 ); //true cuz r>m
+ VERIFY( str_0 > str_2 );
+ VERIFY( !(str_0 > str_3) );
+@@ -231,14 +231,137 @@
+ VERIFY( !("costa ricans" <= str_0) );
+ VERIFY( "costa rica" <= str_0 );
+ VERIFY( str_0 <= "costa rica" );
++}
+
+- return 0;
++constexpr bool
++test02()
++{
++ std::string_view str_0("costa rica");
++ std::string_view str_1("costa marbella");
++ std::string_view str_2("cost");
++ std::string_view str_3("costa ricans");
++ std::string_view str_4;
++
++#undef VERIFY
++#define VERIFY(x) if (!(x)) return false
++
++ str_4 = str_0;
++ //comparisons between string objects
++ VERIFY( !(str_0 == str_1) );
++ VERIFY( !(str_0 == str_2) );
++ VERIFY( !(str_0 == str_3) );
++ VERIFY( !(str_1 == str_0) );
++ VERIFY( !(str_2 == str_0) );
++ VERIFY( !(str_3 == str_0) );
++ VERIFY( str_4 == str_0 );
++ VERIFY( str_0 == str_4 );
++
++ VERIFY( str_0 != str_1 );
++ VERIFY( str_0 != str_2 );
++ VERIFY( str_0 != str_3 );
++ VERIFY( str_1 != str_0 );
++ VERIFY( str_2 != str_0 );
++ VERIFY( str_3 != str_0 );
++ VERIFY( !(str_0 != str_4) );
++ VERIFY( !(str_4 != str_0) );
++
++ VERIFY( str_0 > str_1 ); //true cuz r>m
++ VERIFY( str_0 > str_2 );
++ VERIFY( !(str_0 > str_3) );
++ VERIFY( !(str_1 > str_0) ); //false cuz m<r
++ VERIFY( !(str_2 > str_0) );
++ VERIFY( str_3 > str_0 );
++ VERIFY( !(str_0 > str_4) );
++ VERIFY( !(str_4 > str_0) );
++
++ VERIFY( !(str_0 < str_1) ); //false cuz r>m
++ VERIFY( !(str_0 < str_2) );
++ VERIFY( str_0 < str_3 );
++ VERIFY( str_1 < str_0 ); //true cuz m<r
++ VERIFY( str_2 < str_0 );
++ VERIFY( !(str_3 < str_0) );
++ VERIFY( !(str_0 < str_4) );
++ VERIFY( !(str_4 < str_0) );
++
++ VERIFY( str_0 >= str_1 ); //true cuz r>m
++ VERIFY( str_0 >= str_2 );
++ VERIFY( !(str_0 >= str_3) );
++ VERIFY( !(str_1 >= str_0) );//false cuz m<r
++ VERIFY( !(str_2 >= str_0) );
++ VERIFY( str_3 >= str_0 );
++ VERIFY( str_0 >= str_4 );
++ VERIFY( str_4 >= str_0 );
++
++ VERIFY( !(str_0 <= str_1) );//false cuz r>m
++ VERIFY( !(str_0 <= str_2) );
++ VERIFY( str_0 <= str_3 );
++ VERIFY( str_1 <= str_0 );//true cuz m<r
++ VERIFY( str_2 <= str_0 );
++ VERIFY( !(str_3 <= str_0) );
++ VERIFY( str_0 <= str_4 );
++ VERIFY( str_4 <= str_0 );
++
++ //comparisons between string object and string literal
++ VERIFY( !(str_0 == "costa marbella") );
++ VERIFY( !(str_0 == "cost") );
++ VERIFY( !(str_0 == "costa ricans") );
++ VERIFY( !("costa marbella" == str_0) );
++ VERIFY( !("cost" == str_0) );
++ VERIFY( !("costa ricans" == str_0) );
++ VERIFY( "costa rica" == str_0 );
++ VERIFY( str_0 == "costa rica" );
++
++ VERIFY( str_0 != "costa marbella" );
++ VERIFY( str_0 != "cost" );
++ VERIFY( str_0 != "costa ricans" );
++ VERIFY( "costa marbella" != str_0 );
++ VERIFY( "cost" != str_0 );
++ VERIFY( "costa ricans" != str_0 );
++ VERIFY( !("costa rica" != str_0) );
++ VERIFY( !(str_0 != "costa rica") );
++
++ VERIFY( str_0 > "costa marbella" ); //true cuz r>m
++ VERIFY( str_0 > "cost" );
++ VERIFY( !(str_0 > "costa ricans") );
++ VERIFY( !("costa marbella" > str_0) );//false cuz m<r
++ VERIFY( !("cost" > str_0) );
++ VERIFY( "costa ricans" > str_0 );
++ VERIFY( !("costa rica" > str_0) );
++ VERIFY( !(str_0 > "costa rica") );
++
++ VERIFY( !(str_0 < "costa marbella") );//false cuz r>m
++ VERIFY( !(str_0 < "cost") );
++ VERIFY( str_0 < "costa ricans" );
++ VERIFY( "costa marbella" < str_0 );//true cuz m<r
++ VERIFY( "cost" < str_0 );
++ VERIFY( !("costa ricans" < str_0) );
++ VERIFY( !("costa rica" < str_0) );
++ VERIFY( !(str_0 < "costa rica") );
++
++ VERIFY( str_0 >= "costa marbella" );//true cuz r>m
++ VERIFY( str_0 >= "cost" );
++ VERIFY( !(str_0 >= "costa ricans") );
++ VERIFY( !("costa marbella" >= str_0) );//false cuz m<r
++ VERIFY( !("cost" >= str_0) );
++ VERIFY( "costa ricans" >= str_0 );
++ VERIFY( "costa rica" >= str_0 );
++ VERIFY( str_0 >= "costa rica" );
++
++ VERIFY( !(str_0 <= "costa marbella") );//false cuz r>m
++ VERIFY( !(str_0 <= "cost") );
++ VERIFY( str_0 <= "costa ricans" );
++ VERIFY( "costa marbella" <= str_0 );//true cuz m<r
++ VERIFY( "cost" <= str_0 );
++ VERIFY( !("costa ricans" <= str_0) );
++ VERIFY( "costa rica" <= str_0 );
++ VERIFY( str_0 <= "costa rica" );
++
++ return true;
+ }
+
+ int
+-main()
++main()
+ {
+ test01();
+-
+- return 0;
++ static_assert( test02() );
+ }
+Index: libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc (.../branches/gcc-7-branch)
+@@ -74,20 +74,20 @@
+ }
+
+ #ifndef __cpp_lib_constexpr_char_traits
+-// #error Feature-test macro for constexpr char_traits is missing
++# error Feature-test macro for constexpr char_traits is missing
+ #elif __cpp_lib_constexpr_char_traits != 201611
+-// #error Feature-test macro for constexpr char_traits has the wrong value
++# error Feature-test macro for constexpr char_traits has the wrong value
+ #endif
+
+ static_assert( test_assign<std::char_traits<char>>() );
+-// static_assert( test_compare<std::char_traits<char>>() );
+-// static_assert( test_length<std::char_traits<char>>() );
+-// static_assert( test_find<std::char_traits<char>>() );
++static_assert( test_compare<std::char_traits<char>>() );
++static_assert( test_length<std::char_traits<char>>() );
++static_assert( test_find<std::char_traits<char>>() );
+ #ifdef _GLIBCXX_USE_WCHAR_T
+ static_assert( test_assign<std::char_traits<wchar_t>>() );
+-// static_assert( test_compare<std::char_traits<wchar_t>>() );
+-// static_assert( test_length<std::char_traits<wchar_t>>() );
+-// static_assert( test_find<std::char_traits<wchar_t>>() );
++static_assert( test_compare<std::char_traits<wchar_t>>() );
++static_assert( test_length<std::char_traits<wchar_t>>() );
++static_assert( test_find<std::char_traits<wchar_t>>() );
+ #endif
+ static_assert( test_assign<std::char_traits<char16_t>>() );
+ static_assert( test_compare<std::char_traits<char16_t>>() );
+Index: libstdc++-v3/testsuite/21_strings/basic_string/lwg2946.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string/lwg2946.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string/lwg2946.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,41 @@
++// { dg-options "-std=gnu++17" }
++// { dg-do compile }
++
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++#include <string>
++
++int main()
++{
++ std::string s({"abc", 1});
++ s = {"abc", 1};
++ s += {"abc", 1};
++ s.append({"abc", 1});
++ s.assign({"abc", 1});
++ s.insert(0, {"abc", 1});
++ s.replace(0, 1, {"abc", 1});
++ s.replace(s.begin(), s.begin(), {"abc", 1});
++ s.find({"abc", 1});
++ s.rfind({"abc", 1});
++ s.find_first_of({"abc", 1});
++ s.find_last_of({"abc", 1});
++ s.find_first_not_of({"abc", 1});
++ s.find_last_not_of({"abc", 1});
++ s.compare({"abc", 1});
++ s.compare(0, 1, {"abc", 1});
++}
+Index: libstdc++-v3/testsuite/21_strings/basic_string/79162.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/21_strings/basic_string/79162.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/21_strings/basic_string/79162.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,37 @@
++// { dg-options "-std=gnu++17" }
++// { dg-do compile }
++
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++#include <string>
++
++template <class DataType>
++class opt : public DataType
++{
++ opt(const opt &) = delete;
++ opt &operator=(const opt &) = delete;
++public:
++ opt() {}
++};
++
++int main()
++{
++ opt<std::string> PGOTestProfileFile;
++ std::string ProfileFileName;
++ ProfileFileName = PGOTestProfileFile;
++}
+Index: libstdc++-v3/testsuite/experimental/string_view/operations/compare/char/70483.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/experimental/string_view/operations/compare/char/70483.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/experimental/string_view/operations/compare/char/70483.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,68 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-do compile { target c++14 } }
++
++#include <experimental/string_view>
++
++struct constexpr_char_traits : std::char_traits<char>
++{
++ static constexpr size_t
++ length(const char* val)
++ {
++ size_t res = 0;
++ for (; val[res] != '\0'; ++res)
++ ;
++ return res;
++ }
++
++ static constexpr int
++ compare(const char* lhs, const char* rhs, std::size_t count)
++ {
++ for (size_t pos = 0; pos < count; ++pos)
++ {
++ if (lhs[pos] != rhs[pos])
++ return lhs[pos] - rhs[pos];
++ }
++ return 0;
++ }
++
++ static constexpr const char*
++ find(const char* p, std::size_t n, char c)
++ {
++ for (size_t pos = 0; pos < n; ++pos)
++ if (p[pos] == c)
++ return p + pos;
++ return nullptr;
++ }
++};
++
++using string_view
++ = std::experimental::basic_string_view<char, constexpr_char_traits>;
++
++constexpr
++string_view get()
++{
++ string_view res = "x::";
++ string_view start_pattern = "x";
++ res = res.substr(res.find(start_pattern) + start_pattern.size());
++ res = res.substr(0, res.find_first_of(";]"));
++ res = res.substr(res.rfind("::"));
++ return res;
++}
++
++static_assert( get() == get() );
Index: libstdc++-v3/testsuite/17_intro/names.cc
===================================================================
--- a/src/libstdc++-v3/testsuite/17_intro/names.cc (.../tags/gcc_7_2_0_release)
@@ -1034,6 +5053,103 @@ Index: libstdc++-v3/testsuite/17_intro/names.cc
+#endif
+
#include <bits/stdc++.h>
+Index: libstdc++-v3/testsuite/20_util/duration/literals/range.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/duration/literals/range.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/duration/literals/range.cc (.../branches/gcc-7-branch)
+@@ -26,6 +26,6 @@
+
+ // std::numeric_limits<int64_t>::max() == 9223372036854775807;
+ auto h = 9223372036854775808h;
+- // { dg-error "cannot be represented" "" { target *-*-* } 892 }
++ // { dg-error "cannot be represented" "" { target *-*-* } 893 }
+ }
+ // { dg-prune-output "in constexpr expansion" } // needed for -O0
+Index: libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/duration/cons/dr1177.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,41 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-do compile { target c++11 } }
++
++#include <chrono>
++#include <type_traits>
++
++using namespace std;
++using namespace std::chrono;
++
++// DR 1177
++static_assert(is_constructible<duration<float>, duration<double>>{},
++ "can convert duration with one floating point rep to another");
++static_assert(is_constructible<duration<float>, duration<int>>{},
++ "can convert duration with integral rep to one with floating point rep");
++static_assert(!is_constructible<duration<int>, duration<float>>{},
++ "cannot convert duration with floating point rep to one with integral rep");
++static_assert(is_constructible<duration<int>, duration<long>>{},
++ "can convert duration with one integral rep to another");
++
++static_assert(!is_constructible<duration<int>, duration<int, ratio<2,3>>>{},
++ "cannot convert duration to one with different period");
++static_assert(is_constructible<duration<float>, duration<int, ratio<2,3>>>{},
++ "unless it has a floating-point representation");
++static_assert(is_constructible<duration<float>, duration<int, ratio<1,3>>>{},
++ "or a period that is an integral multiple of the original");
+Index: libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc
+===================================================================
+--- a/src/libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc (.../tags/gcc_7_2_0_release)
++++ b/src/libstdc++-v3/testsuite/20_util/time_point/cons/81468.cc (.../branches/gcc-7-branch)
+@@ -0,0 +1,34 @@
++// Copyright (C) 2017 Free Software Foundation, Inc.
++//
++// This file is part of the GNU ISO C++ Library. This library is free
++// software; you can redistribute it and/or modify it under the
++// terms of the GNU General Public License as published by the
++// Free Software Foundation; either version 3, or (at your option)
++// any later version.
++
++// This library is distributed in the hope that it will be useful,
++// but WITHOUT ANY WARRANTY; without even the implied warranty of
++// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++// GNU General Public License for more details.
++
++// You should have received a copy of the GNU General Public License along
++// with this library; see the file COPYING3. If not see
++// <http://www.gnu.org/licenses/>.
++
++// { dg-do compile { target c++11 } }
++
++#include <chrono>
++#include <type_traits>
++
++using namespace std;
++using namespace std::chrono;
++
++template <class Duration>
++ using sys_time = time_point<system_clock, Duration>;
++
++static_assert(is_constructible<sys_time<milliseconds>, sys_time<seconds>>{},
++ "Can construct time_point from one with lower precision duration");
++
++// PR libstdc++/81468 - DR 1177
++static_assert(!is_constructible<sys_time<seconds>, sys_time<milliseconds>>{},
++ "Cannot construct time_point from one with higher precision duration");
Index: libstdc++-v3/config/io/basic_file_stdio.cc
===================================================================
--- a/src/libstdc++-v3/config/io/basic_file_stdio.cc (.../tags/gcc_7_2_0_release)
@@ -1148,7 +5264,7 @@ Index: gcc/DATESTAMP
+++ b/src/gcc/DATESTAMP (.../branches/gcc-7-branch)
@@ -1 +1 @@
-20170814
-+20170912
++20170913
Index: gcc/tree.c
===================================================================
--- a/src/gcc/tree.c (.../tags/gcc_7_2_0_release)
@@ -1447,7 +5563,18 @@ Index: gcc/ChangeLog
===================================================================
--- a/src/gcc/ChangeLog (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/ChangeLog (.../branches/gcc-7-branch)
-@@ -1,3 +1,344 @@
+@@ -1,3 +1,355 @@
++2017-09-12 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2017-09-05 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR target/81833
++ * config/rs6000/altivec.md (altivec_vsum2sws): Convert from a
++ define_insn to a define_expand.
++ (altivec_vsum2sws_direct): New define_insn.
++ (altivec_vsumsws): Convert from a define_insn to a define_expand.
++
+2017-09-11 Max Filippov <jcmvbkbc at gmail.com>
+
+ Backport from mainline
@@ -1792,6 +5919,70 @@ Index: gcc/ChangeLog
2017-08-14 Release Manager
* GCC 7.2.0 released.
+Index: gcc/testsuite/gcc.target/powerpc/pr81833-1.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/powerpc/pr81833-1.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/powerpc/pr81833-1.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,59 @@
++/* PR81833: This used to fail due to improper implementation of vec_msum. */
++/* Test case relies on -mcpu=power7 or later. Currently we don't have
++ machinery to express that, so we have two separate tests for -mcpu=power7
++ and -mcpu=power8 to catch 32-bit BE on P7 and 64-bit BE/LE on P8. */
++
++/* { dg-do run } */
++/* { dg-require-effective-target p8vector_hw } */
++/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power8" } } */
++/* { dg-options "-mcpu=power8 -O2" } */
++
++#include <altivec.h>
++
++#define vec_u8 vector unsigned char
++#define vec_s8 vector signed char
++#define vec_u16 vector unsigned short
++#define vec_s16 vector signed short
++#define vec_u32 vector unsigned int
++#define vec_s32 vector signed int
++#define vec_f vector float
++
++#define LOAD_ZERO const vec_u8 zerov = vec_splat_u8 (0)
++
++#define zero_u8v (vec_u8) zerov
++#define zero_s8v (vec_s8) zerov
++#define zero_u16v (vec_u16) zerov
++#define zero_s16v (vec_s16) zerov
++#define zero_u32v (vec_u32) zerov
++#define zero_s32v (vec_s32) zerov
++
++signed int __attribute__((noinline))
++scalarproduct_int16_vsx (const signed short *v1, const signed short *v2,
++ int order)
++{
++ int i;
++ LOAD_ZERO;
++ register vec_s16 vec1;
++ register vec_s32 res = vec_splat_s32 (0), t;
++ signed int ires;
++
++ for (i = 0; i < order; i += 8) {
++ vec1 = vec_vsx_ld (0, v1);
++ t = vec_msum (vec1, vec_vsx_ld (0, v2), zero_s32v);
++ res = vec_sums (t, res);
++ v1 += 8;
++ v2 += 8;
++ }
++ res = vec_splat (res, 3);
++ vec_ste (res, 0, &ires);
++
++ return ires;
++}
++
++int main(void)
++{
++ const signed short test_vec[] = { 1, 1, 1, 1, 1, 1, 1, 1 };
++ if (scalarproduct_int16_vsx (test_vec, test_vec, 8) != 8)
++ __builtin_abort ();
++ return 0;
++}
Index: gcc/testsuite/gcc.target/powerpc/vec-setup-be-long.c
===================================================================
--- a/src/gcc/testsuite/gcc.target/powerpc/vec-setup-be-long.c (.../tags/gcc_7_2_0_release)
@@ -1808,6 +5999,70 @@ Index: gcc/testsuite/gcc.target/powerpc/vec-setup-be-long.c
+ This test explicitly tests -maltivec=be to make sure things are correct. */
+
+#include "vec-setup.h"
+Index: gcc/testsuite/gcc.target/powerpc/pr81833-2.c
+===================================================================
+--- a/src/gcc/testsuite/gcc.target/powerpc/pr81833-2.c (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/testsuite/gcc.target/powerpc/pr81833-2.c (.../branches/gcc-7-branch)
+@@ -0,0 +1,59 @@
++/* PR81833: This used to fail due to improper implementation of vec_msum. */
++/* Test case relies on -mcpu=power7 or later. Currently we don't have
++ machinery to express that, so we have two separate tests for -mcpu=power7
++ and -mcpu=power8 to catch 32-bit BE on P7 and 64-bit BE/LE on P8. */
++
++/* { dg-do run } */
++/* { dg-require-effective-target vsx_hw } */
++/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power7" } } */
++/* { dg-options "-mcpu=power7 -O2" } */
++
++#include <altivec.h>
++
++#define vec_u8 vector unsigned char
++#define vec_s8 vector signed char
++#define vec_u16 vector unsigned short
++#define vec_s16 vector signed short
++#define vec_u32 vector unsigned int
++#define vec_s32 vector signed int
++#define vec_f vector float
++
++#define LOAD_ZERO const vec_u8 zerov = vec_splat_u8 (0)
++
++#define zero_u8v (vec_u8) zerov
++#define zero_s8v (vec_s8) zerov
++#define zero_u16v (vec_u16) zerov
++#define zero_s16v (vec_s16) zerov
++#define zero_u32v (vec_u32) zerov
++#define zero_s32v (vec_s32) zerov
++
++signed int __attribute__((noinline))
++scalarproduct_int16_vsx (const signed short *v1, const signed short *v2,
++ int order)
++{
++ int i;
++ LOAD_ZERO;
++ register vec_s16 vec1;
++ register vec_s32 res = vec_splat_s32 (0), t;
++ signed int ires;
++
++ for (i = 0; i < order; i += 8) {
++ vec1 = vec_vsx_ld (0, v1);
++ t = vec_msum (vec1, vec_vsx_ld (0, v2), zero_s32v);
++ res = vec_sums (t, res);
++ v1 += 8;
++ v2 += 8;
++ }
++ res = vec_splat (res, 3);
++ vec_ste (res, 0, &ires);
++
++ return ires;
++}
++
++int main(void)
++{
++ const signed short test_vec[] = { 1, 1, 1, 1, 1, 1, 1, 1 };
++ if (scalarproduct_int16_vsx (test_vec, test_vec, 8) != 8)
++ __builtin_abort ();
++ return 0;
++}
Index: gcc/testsuite/gcc.target/powerpc/vec-setup.h
===================================================================
--- a/src/gcc/testsuite/gcc.target/powerpc/vec-setup.h (.../tags/gcc_7_2_0_release)
@@ -3463,7 +7718,16 @@ Index: gcc/testsuite/ChangeLog
===================================================================
--- a/src/gcc/testsuite/ChangeLog (.../tags/gcc_7_2_0_release)
+++ b/src/gcc/testsuite/ChangeLog (.../branches/gcc-7-branch)
-@@ -1,3 +1,268 @@
+@@ -1,3 +1,277 @@
++2017-09-12 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ Backport from mainline
++ 2017-09-05 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
++
++ PR target/81833
++ * gcc.target/powerpc/pr81833-1.c: New file.
++ * gcc.target/powerpc/pr81833-2.c: New file.
++
+2017-09-10 Bill Schmidt <wschmidt at linux.vnet.ibm.com>
+
+ Backport from mainline
@@ -308689,6 +312953,105 @@ Index: gcc/config/rs6000/vsx.md
;; Extract a DF/DI element from V2DF/V2DI
;; Optimize cases were we can do a simple or direct move.
+Index: gcc/config/rs6000/altivec.md
+===================================================================
+--- a/src/gcc/config/rs6000/altivec.md (.../tags/gcc_7_2_0_release)
++++ b/src/gcc/config/rs6000/altivec.md (.../branches/gcc-7-branch)
+@@ -1749,51 +1749,61 @@
+ "vsum4s<VI_char>s %0,%1,%2"
+ [(set_attr "type" "veccomplex")])
+
+-;; FIXME: For the following two patterns, the scratch should only be
+-;; allocated for !VECTOR_ELT_ORDER_BIG, and the instructions should
+-;; be emitted separately.
+-(define_insn "altivec_vsum2sws"
+- [(set (match_operand:V4SI 0 "register_operand" "=v")
+- (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
+- (match_operand:V4SI 2 "register_operand" "v")]
+- UNSPEC_VSUM2SWS))
+- (set (reg:SI VSCR_REGNO) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))
+- (clobber (match_scratch:V4SI 3 "=v"))]
++(define_expand "altivec_vsum2sws"
++ [(use (match_operand:V4SI 0 "register_operand"))
++ (use (match_operand:V4SI 1 "register_operand"))
++ (use (match_operand:V4SI 2 "register_operand"))]
+ "TARGET_ALTIVEC"
+ {
+ if (VECTOR_ELT_ORDER_BIG)
+- return "vsum2sws %0,%1,%2";
++ emit_insn (gen_altivec_vsum2sws_direct (operands[0], operands[1],
++ operands[2]));
+ else
+- return "vsldoi %3,%2,%2,12\n\tvsum2sws %3,%1,%3\n\tvsldoi %0,%3,%3,4";
+-}
+- [(set_attr "type" "veccomplex")
+- (set (attr "length")
+- (if_then_else
+- (match_test "VECTOR_ELT_ORDER_BIG")
+- (const_string "4")
+- (const_string "12")))])
++ {
++ rtx tmp1 = gen_reg_rtx (V4SImode);
++ rtx tmp2 = gen_reg_rtx (V4SImode);
++ emit_insn (gen_altivec_vsldoi_v4si (tmp1, operands[2],
++ operands[2], GEN_INT (12)));
++ emit_insn (gen_altivec_vsum2sws_direct (tmp2, operands[1], tmp1));
++ emit_insn (gen_altivec_vsldoi_v4si (operands[0], tmp2, tmp2,
++ GEN_INT (4)));
++ }
++ DONE;
++})
+
+-(define_insn "altivec_vsumsws"
++; FIXME: This can probably be expressed without an UNSPEC.
++(define_insn "altivec_vsum2sws_direct"
+ [(set (match_operand:V4SI 0 "register_operand" "=v")
+ (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
+- (match_operand:V4SI 2 "register_operand" "v")]
+- UNSPEC_VSUMSWS))
+- (set (reg:SI VSCR_REGNO) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))
+- (clobber (match_scratch:V4SI 3 "=v"))]
++ (match_operand:V4SI 2 "register_operand" "v")]
++ UNSPEC_VSUM2SWS))
++ (set (reg:SI VSCR_REGNO) (unspec:SI [(const_int 0)] UNSPEC_SET_VSCR))]
+ "TARGET_ALTIVEC"
++ "vsum2sws %0,%1,%2"
++ [(set_attr "type" "veccomplex")])
++
++(define_expand "altivec_vsumsws"
++ [(use (match_operand:V4SI 0 "register_operand"))
++ (use (match_operand:V4SI 1 "register_operand"))
++ (use (match_operand:V4SI 2 "register_operand"))]
++ "TARGET_ALTIVEC"
+ {
+ if (VECTOR_ELT_ORDER_BIG)
+- return "vsumsws %0,%1,%2";
++ emit_insn (gen_altivec_vsumsws_direct (operands[0], operands[1],
++ operands[2]));
+ else
+- return "vspltw %3,%2,0\n\tvsumsws %3,%1,%3\n\tvsldoi %0,%3,%3,12";
+-}
+- [(set_attr "type" "veccomplex")
+- (set (attr "length")
+- (if_then_else
+- (match_test "(VECTOR_ELT_ORDER_BIG)")
+- (const_string "4")
+- (const_string "12")))])
++ {
++ rtx tmp1 = gen_reg_rtx (V4SImode);
++ rtx tmp2 = gen_reg_rtx (V4SImode);
++ emit_insn (gen_altivec_vspltw_direct (tmp1, operands[2], const0_rtx));
++ emit_insn (gen_altivec_vsumsws_direct (tmp2, operands[1], tmp1));
++ emit_insn (gen_altivec_vsldoi_v4si (operands[0], tmp2, tmp2,
++ GEN_INT (12)));
++ }
++ DONE;
++})
+
++; FIXME: This can probably be expressed without an UNSPEC.
+ (define_insn "altivec_vsumsws_direct"
+ [(set (match_operand:V4SI 0 "register_operand" "=v")
+ (unspec:V4SI [(match_operand:V4SI 1 "register_operand" "v")
Index: gcc/config/rs6000/sysv4.h
===================================================================
--- a/src/gcc/config/rs6000/sysv4.h (.../tags/gcc_7_2_0_release)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/gcc-7.git
More information about the Reproducible-commits
mailing list