PR libstdc++/82685 add 'noexcept' to string_view literals

Backport from mainline
2017-10-24  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/82685
	* include/experimental/string_view (operator""sv): Add noexcept.
	* include/std/string_view (operator""sv): Likewise.

From-SVN: r255325
This commit is contained in:
Jonathan Wakely 2017-12-01 17:12:07 +00:00 committed by Jonathan Wakely
parent c4e8c8d71c
commit e737fc0cba
3 changed files with 15 additions and 8 deletions

View File

@ -1,5 +1,12 @@
2017-12-01 Jonathan Wakely <jwakely@redhat.com>
Backport from mainline
2017-10-24 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/82685
* include/experimental/string_view (operator""sv): Add noexcept.
* include/std/string_view (operator""sv): Likewise.
Backport from mainline
2017-11-30 Jonathan Wakely <jwakely@redhat.com>

View File

@ -660,22 +660,22 @@ namespace experimental
_GLIBCXX_BEGIN_NAMESPACE_VERSION
inline constexpr basic_string_view<char>
operator""sv(const char* __str, size_t __len)
operator""sv(const char* __str, size_t __len) noexcept
{ return basic_string_view<char>{__str, __len}; }
#ifdef _GLIBCXX_USE_WCHAR_T
inline constexpr basic_string_view<wchar_t>
operator""sv(const wchar_t* __str, size_t __len)
operator""sv(const wchar_t* __str, size_t __len) noexcept
{ return basic_string_view<wchar_t>{__str, __len}; }
#endif
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
inline constexpr basic_string_view<char16_t>
operator""sv(const char16_t* __str, size_t __len)
operator""sv(const char16_t* __str, size_t __len) noexcept
{ return basic_string_view<char16_t>{__str, __len}; }
inline constexpr basic_string_view<char32_t>
operator""sv(const char32_t* __str, size_t __len)
operator""sv(const char32_t* __str, size_t __len) noexcept
{ return basic_string_view<char32_t>{__str, __len}; }
#endif

View File

@ -644,22 +644,22 @@ _GLIBCXX_END_NAMESPACE_VERSION
_GLIBCXX_BEGIN_NAMESPACE_VERSION
inline constexpr basic_string_view<char>
operator""sv(const char* __str, size_t __len)
operator""sv(const char* __str, size_t __len) noexcept
{ return basic_string_view<char>{__str, __len}; }
#ifdef _GLIBCXX_USE_WCHAR_T
inline constexpr basic_string_view<wchar_t>
operator""sv(const wchar_t* __str, size_t __len)
operator""sv(const wchar_t* __str, size_t __len) noexcept
{ return basic_string_view<wchar_t>{__str, __len}; }
#endif
#ifdef _GLIBCXX_USE_C99_STDINT_TR1
inline constexpr basic_string_view<char16_t>
operator""sv(const char16_t* __str, size_t __len)
operator""sv(const char16_t* __str, size_t __len) noexcept
{ return basic_string_view<char16_t>{__str, __len}; }
inline constexpr basic_string_view<char32_t>
operator""sv(const char32_t* __str, size_t __len)
operator""sv(const char32_t* __str, size_t __len) noexcept
{ return basic_string_view<char32_t>{__str, __len}; }
#endif