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 //===----------------------------------------------------------------------===//
10 // ... manipulating sequences of any non-array trivial standard-layout types.
13 #include "test_traits.h"
16 NotTrivial() : value(3) {}
20 struct NotStandardLayout
{
22 NotStandardLayout() : one(1), two(2) {}
23 int sum() const { return one
+ two
; } // silences "unused field 'two' warning"
34 static_assert(std::is_array
<C
>::value
, "");
35 std::basic_string
<C
, test_traits
<C
> > s
;
36 // expected-error-re@string:* {{static assertion failed{{.*}}Character type of basic_string must not be an array}}
41 static_assert(!std::is_trivial
<NotTrivial
>::value
, "");
42 std::basic_string
<NotTrivial
, test_traits
<NotTrivial
> > s
;
43 // expected-error-re@string:* {{static assertion failed{{.*}}Character type of basic_string must be trivial}}
47 // not standard layout
48 static_assert(!std::is_standard_layout
<NotStandardLayout
>::value
, "");
49 std::basic_string
<NotStandardLayout
, test_traits
<NotStandardLayout
> > s
;
50 // expected-error-re@string:* {{static assertion failed{{.*}}Character type of basic_string must be standard-layout}}