Marshall Clow | 85d3e7a | 2014-04-26 05:19:48 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
Eric Fiselier | 0a52cd7 | 2015-02-19 02:10:42 +0000 | [diff] [blame] | 10 | |
| 11 | // UNSUPPORTED: c++98, c++03 |
| 12 | |
Marshall Clow | 85d3e7a | 2014-04-26 05:19:48 +0000 | [diff] [blame] | 13 | // Tuples of smart pointers; based on bug #18350 |
| 14 | // auto_ptr doesn't have a copy constructor that takes a const &, but tuple does. |
| 15 | |
| 16 | #include <tuple> |
| 17 | #include <memory> |
| 18 | |
| 19 | int main () { |
| 20 | { |
| 21 | std::tuple<std::unique_ptr<char>> up; |
| 22 | std::tuple<std::shared_ptr<char>> sp; |
| 23 | std::tuple<std::weak_ptr <char>> wp; |
Marshall Clow | 85d3e7a | 2014-04-26 05:19:48 +0000 | [diff] [blame] | 24 | } |
| 25 | { |
| 26 | std::tuple<std::unique_ptr<char[]>> up; |
| 27 | std::tuple<std::shared_ptr<char[]>> sp; |
| 28 | std::tuple<std::weak_ptr <char[]>> wp; |
Marshall Clow | 85d3e7a | 2014-04-26 05:19:48 +0000 | [diff] [blame] | 29 | } |
Eric Fiselier | 1ff954f | 2016-06-15 19:41:52 +0000 | [diff] [blame] | 30 | // Smart pointers of type 'T[N]' are not tested here since they are not |
| 31 | // supported by the standard nor by libc++'s implementation. |
Stephan T. Lavavej | ade3223 | 2017-08-05 00:44:24 +0000 | [diff] [blame] | 32 | // See https://reviews.llvm.org/D21320 for more information. |
Eric Fiselier | 46fb2b9 | 2016-06-22 01:23:51 +0000 | [diff] [blame] | 33 | } |