Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions stl/inc/xstring
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,10 @@ public:
"Bad char_traits for basic_string_view; "
"N4659 24.4.2 [string.view.template]/1 \"the type traits::char_type shall name the same type as charT.\"");

static_assert(!is_array_v<_Elem> && is_trivial_v<_Elem> && is_standard_layout_v<_Elem>,
"The character type of basic_string_view must be a non-array trivial standard-layout type. See N4861 "
"[strings.general]/1.");

using traits_type = _Traits;
using value_type = _Elem;
using pointer = _Elem*;
Expand Down Expand Up @@ -2278,6 +2282,10 @@ private:
"N4659 24.3.2.1 [string.require]/3 requires that the supplied "
"char_traits character type match the string's character type.");

static_assert(!is_array_v<_Elem> && is_trivial_v<_Elem> && is_standard_layout_v<_Elem>,
"The character type of basic_string must be a non-array trivial standard-layout type. See N4861 "
"[strings.general]/1.");

public:
using traits_type = _Traits;
using allocator_type = _Alloc;
Expand Down
3 changes: 0 additions & 3 deletions tests/libcxx/expected_results.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,6 @@ std/containers/sequences/array/array.data/data_const.pass.cpp FAIL
std/containers/sequences/array/array.data/data.pass.cpp FAIL
std/containers/sequences/array/iterators.pass.cpp FAIL

# STL bug: string_view doesn't enforce "non-array trivial standard-layout", related to LWG-3034.
std/strings/string.view/char.bad.fail.cpp:0 FAIL

# Predicate count assertions - IDL2 is slightly bending the Standard's rules here.
std/algorithms/alg.sorting/alg.heap.operations/make.heap/make_heap_comp.pass.cpp FAIL
std/algorithms/alg.sorting/alg.merge/inplace_merge_comp.pass.cpp FAIL
Expand Down
3 changes: 0 additions & 3 deletions tests/libcxx/skipped_tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,6 @@ containers\sequences\array\array.data\data_const.pass.cpp
containers\sequences\array\array.data\data.pass.cpp
containers\sequences\array\iterators.pass.cpp

# STL bug: string_view doesn't enforce "non-array trivial standard-layout", related to LWG-3034.
strings\string.view\char.bad.fail.cpp

# Predicate count assertions - IDL2 is slightly bending the Standard's rules here.
algorithms\alg.sorting\alg.heap.operations\make.heap\make_heap_comp.pass.cpp
algorithms\alg.sorting\alg.merge\inplace_merge_comp.pass.cpp
Expand Down