Implement LWG3034: P0767R1 breaks previously-standard-layout types

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328064 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/string b/include/string
index 2630799..7218aa2 100644
--- a/include/string
+++ b/include/string
@@ -658,10 +658,12 @@
     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;
diff --git a/include/string_view b/include/string_view
index fd8c379..6377aeb 100644
--- a/include/string_view
+++ b/include/string_view
@@ -208,7 +208,9 @@
     typedef ptrdiff_t                                  difference_type;
     static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1);
 
-    static_assert(is_trivial<value_type>::value, "Character type of basic_string_view must be trivial");
+    static_assert((!is_array<value_type>::value), "Character type of basic_string_view must not be an array");
+    static_assert(( is_standard_layout<value_type>::value), "Character type of basic_string_view must be standard-layout");
+    static_assert(( is_trivial<value_type>::value), "Character type of basic_string_view 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");