]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Add noexcept-specifier to basic_string_view(It, End)
authorJonathan Wakely <jwakely@redhat.com>
Wed, 14 Jul 2021 10:03:17 +0000 (11:03 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 14 Jul 2021 11:23:33 +0000 (12:23 +0100)
commitf9c2ce1dae270d8d5dc261a57a21f96a1da5ea2d
tree6eba485c5f94f880078818b4ab5572108e67aff5
parenta967a3efd39280fe3f5774e45490e991f8e99059
libstdc++: Add noexcept-specifier to basic_string_view(It, End)

This adds a conditional noexcept to the C++20 constructor. The
std::to_address call cannot throw, so only taking the difference of the
two iterators can throw.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/std/string_view (basic_string_view(It, End)): Add
noexcept-specifier.
* testsuite/21_strings/basic_string_view/cons/char/range.cc:
Check noexcept-specifier. Also check construction without CTAD.
libstdc++-v3/include/std/string_view
libstdc++-v3/testsuite/21_strings/basic_string_view/cons/char/range.cc
This page took 0.068941 seconds and 6 git commands to generate.