diff --git a/stl/inc/xstring b/stl/inc/xstring index ac4faad1c..e7878324b 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -1274,8 +1274,10 @@ public: #if _HAS_CXX23 // clang-format off - template <_RANGES contiguous_range _Range> - requires (_RANGES sized_range<_Range> + template + requires (!same_as, basic_string_view> // per LWG issue filed on 2021-08-16 + && _RANGES contiguous_range<_Range> + && _RANGES sized_range<_Range> && same_as<_RANGES range_value_t<_Range>, _Elem> && (!is_convertible_v<_Range, const _Elem*>) && (!requires(remove_cvref_t<_Range>& _Rng) { diff --git a/tests/std/tests/P0220R1_string_view/test.cpp b/tests/std/tests/P0220R1_string_view/test.cpp index 088c1eb71..0eaa18178 100644 --- a/tests/std/tests/P0220R1_string_view/test.cpp +++ b/tests/std/tests/P0220R1_string_view/test.cpp @@ -74,6 +74,19 @@ const evil_conversion_to_string_view_lvalue_only convert_lvalue_only{}; static_assert(is_trivially_copyable_v); static_assert(is_trivially_copyable_v); +// Similar non-standard guarantees +static_assert(is_trivially_move_constructible_v); +static_assert(is_trivially_copy_constructible_v); +static_assert(is_trivially_move_assignable_v); +static_assert(is_trivially_copy_assignable_v); +static_assert(is_trivially_destructible_v); + +static_assert(is_trivially_move_constructible_v); +static_assert(is_trivially_copy_constructible_v); +static_assert(is_trivially_move_assignable_v); +static_assert(is_trivially_copy_assignable_v); +static_assert(is_trivially_destructible_v); + // noexcept assertions: // (functions that explicitly throw have their throws tested and therefore have no static_asserts) static_assert(noexcept(string_view{}), "default constructor not noexcept");