Eric Fiselier | 80e66ac | 2016-11-23 01:02:51 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===----------------------------------------------------------------------===// |
| 3 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Eric Fiselier | 80e66ac | 2016-11-23 01:02:51 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // UNSUPPORTED: c++98, c++03, c++11, c++14 |
| 11 | |
| 12 | // <variant> |
| 13 | |
| 14 | // struct monostate {}; |
| 15 | |
| 16 | #include <type_traits> |
| 17 | #include <variant> |
| 18 | |
Marshall Clow | 7fc6a55 | 2019-05-31 18:35:30 +0000 | [diff] [blame] | 19 | #include "test_macros.h" |
| 20 | |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 21 | int main(int, char**) { |
Eric Fiselier | 80e66ac | 2016-11-23 01:02:51 +0000 | [diff] [blame] | 22 | using M = std::monostate; |
| 23 | static_assert(std::is_trivially_default_constructible<M>::value, ""); |
| 24 | static_assert(std::is_trivially_copy_constructible<M>::value, ""); |
| 25 | static_assert(std::is_trivially_copy_assignable<M>::value, ""); |
| 26 | static_assert(std::is_trivially_destructible<M>::value, ""); |
| 27 | constexpr M m{}; |
| 28 | ((void)m); |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 29 | |
| 30 | return 0; |
Eric Fiselier | 80e66ac | 2016-11-23 01:02:51 +0000 | [diff] [blame] | 31 | } |