summaryrefslogtreecommitdiffstats
path: root/libcxx/include/string
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2018-03-21 00:36:05 +0000
committerMarshall Clow <mclow.lists@gmail.com>2018-03-21 00:36:05 +0000
commit4a6f3c471040807e0ef6534893fdc3fbcdd796a4 (patch)
treeeb919bcc4cf2055f37db18d69a06a34a69f91df9 /libcxx/include/string
parent1c1057af0b56f7d8defbf81c64a53e55cc95c147 (diff)
downloadbcm5719-llvm-4a6f3c471040807e0ef6534893fdc3fbcdd796a4.tar.gz
bcm5719-llvm-4a6f3c471040807e0ef6534893fdc3fbcdd796a4.zip
Implement LWG3034: P0767R1 breaks previously-standard-layout types
llvm-svn: 328064
Diffstat (limited to 'libcxx/include/string')
-rw-r--r--libcxx/include/string8
1 files changed, 5 insertions, 3 deletions
diff --git a/libcxx/include/string b/libcxx/include/string
index 2630799c060..7218aa2e4d4 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -658,10 +658,12 @@ public:
typedef typename __alloc_traits::pointer pointer;
typedef typename __alloc_traits::const_pointer const_pointer;
- static_assert(is_trivial<value_type>::value, "Character type of basic_string must be trivial");
- static_assert((is_same<_CharT, typename traits_type::char_type>::value),
+ static_assert((!is_array<value_type>::value), "Character type of basic_string must not be an array");
+ static_assert(( is_standard_layout<value_type>::value), "Character type of basic_string must be standard-layout");
+ static_assert(( is_trivial<value_type>::value), "Character type of basic_string must be trivial");
+ static_assert(( is_same<_CharT, typename traits_type::char_type>::value),
"traits_type::char_type must be the same type as CharT");
- static_assert((is_same<typename allocator_type::value_type, value_type>::value),
+ static_assert(( is_same<typename allocator_type::value_type, value_type>::value),
"Allocator::value_type must be same type as value_type");
#if defined(_LIBCPP_RAW_ITERATORS)
typedef pointer iterator;
OpenPOWER on IntegriCloud