From: Jonathan Wakely Date: Tue, 24 Oct 2017 11:28:40 +0000 (+0100) Subject: PR libstdc++/82685 add 'noexcept' to string_view literals X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a19d2a2ee10ae74b77e3f2c0d85be2cda38cd54;p=gcc.git PR libstdc++/82685 add 'noexcept' to string_view literals PR libstdc++/82685 * include/experimental/string_view (operator""sv): Add noexcept. * include/std/string_view (operator""sv): Likewise. From-SVN: r254041 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 6bb72144746..aad03d37659 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2017-10-24 Jonathan Wakely + + PR libstdc++/82685 + * include/experimental/string_view (operator""sv): Add noexcept. + * include/std/string_view (operator""sv): Likewise. + 2017-10-23 Jonathan Wakely * include/Makefile.am: Add new headers for C++17 filesystem library. diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view index f05f152302a..8eaf9ec3d96 100644 --- a/libstdc++-v3/include/experimental/string_view +++ b/libstdc++-v3/include/experimental/string_view @@ -645,22 +645,22 @@ namespace experimental inline namespace string_view_literals { inline constexpr basic_string_view - operator""sv(const char* __str, size_t __len) + operator""sv(const char* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } #ifdef _GLIBCXX_USE_WCHAR_T inline constexpr basic_string_view - operator""sv(const wchar_t* __str, size_t __len) + operator""sv(const wchar_t* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } #endif #ifdef _GLIBCXX_USE_C99_STDINT_TR1 inline constexpr basic_string_view - operator""sv(const char16_t* __str, size_t __len) + operator""sv(const char16_t* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } inline constexpr basic_string_view - operator""sv(const char32_t* __str, size_t __len) + operator""sv(const char32_t* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } #endif } // namespace string_literals diff --git a/libstdc++-v3/include/std/string_view b/libstdc++-v3/include/std/string_view index 97316ef49ab..110a235a4c0 100644 --- a/libstdc++-v3/include/std/string_view +++ b/libstdc++-v3/include/std/string_view @@ -636,22 +636,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION inline namespace string_view_literals { inline constexpr basic_string_view - operator""sv(const char* __str, size_t __len) + operator""sv(const char* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } #ifdef _GLIBCXX_USE_WCHAR_T inline constexpr basic_string_view - operator""sv(const wchar_t* __str, size_t __len) + operator""sv(const wchar_t* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } #endif #ifdef _GLIBCXX_USE_C99_STDINT_TR1 inline constexpr basic_string_view - operator""sv(const char16_t* __str, size_t __len) + operator""sv(const char16_t* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } inline constexpr basic_string_view - operator""sv(const char32_t* __str, size_t __len) + operator""sv(const char32_t* __str, size_t __len) noexcept { return basic_string_view{__str, __len}; } #endif } // namespace string_literals