1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: !stdlib=libc++ && (c++03 || c++11 || c++14)
12 // ... manipulating sequences of any non-array trivial standard-layout types.
15 #include "../basic.string/test_traits.h"
18 NotTrivial() : value(3) {}
22 struct NotStandardLayout
{
24 NotStandardLayout() : one(1), two(2) {}
25 int sum() const { return one
+ two
; } // silences "unused field 'two' warning"
32 int main(int, char**) {
36 static_assert(std::is_array
<C
>::value
, "");
37 std::basic_string_view
<C
, test_traits
<C
> > sv
;
38 // expected-error-re@string_view:* {{static assertion failed{{.*}}Character type of basic_string_view must not be an array}}
43 static_assert(!std::is_trivial
<NotTrivial
>::value
, "");
44 std::basic_string_view
<NotTrivial
, test_traits
<NotTrivial
> > sv
;
45 // expected-error-re@string_view:* {{static assertion failed{{.*}}Character type of basic_string_view must be trivial}}
49 // not standard layout
50 static_assert(!std::is_standard_layout
<NotStandardLayout
>::value
, "");
51 std::basic_string_view
<NotStandardLayout
, test_traits
<NotStandardLayout
> > sv
;
52 // expected-error-re@string_view:* {{static assertion failed{{.*}}Character type of basic_string_view must be standard-layout}}