Mercurial > hg > CbC > CbC_gcc
comparison libstdc++-v3/testsuite/20_util/any/cons/90415.cc @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:1830386684a0 | 152:2b5abeee2509 |
---|---|
1 // { dg-options "-std=gnu++17" } | |
2 // { dg-do run { target c++17 } } | |
3 | |
4 // Copyright (C) 2020 Free Software Foundation, Inc. | |
5 // | |
6 // This file is part of the GNU ISO C++ Library. This library is free | |
7 // software; you can redistribute it and/or modify it under the | |
8 // terms of the GNU General Public License as published by the | |
9 // Free Software Foundation; either version 3, or (at your option) | |
10 // any later version. | |
11 | |
12 // This library is distributed in the hope that it will be useful, | |
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 // GNU General Public License for more details. | |
16 | |
17 // You should have received a copy of the GNU General Public License along | |
18 // with this library; see the file COPYING3. If not see | |
19 // <http://www.gnu.org/licenses/>. | |
20 | |
21 #include <any> | |
22 #include <utility> | |
23 #include <tuple> | |
24 #include <testsuite_hooks.h> | |
25 | |
26 void | |
27 test01() | |
28 { | |
29 // PR libstdc++/90415 | |
30 static_assert( std::is_copy_constructible<std::tuple<std::any>>::value ); | |
31 } | |
32 | |
33 struct wrapper | |
34 { | |
35 wrapper() = default; | |
36 | |
37 wrapper(const std::any& t); | |
38 | |
39 wrapper(const wrapper& w); | |
40 | |
41 auto& operator=(const std::any& t); | |
42 | |
43 auto& operator=(const wrapper& w) | |
44 { | |
45 value = w.value; | |
46 return *this; | |
47 } | |
48 | |
49 std::any value; | |
50 }; | |
51 | |
52 void | |
53 test02() | |
54 { | |
55 // PR libstdc++/91630 | |
56 wrapper a, b; | |
57 a = b; | |
58 } | |
59 | |
60 int main() | |
61 { | |
62 test01(); | |
63 test02(); | |
64 } |