]>
Commit | Line | Data |
---|---|---|
bab0a26d JW |
1 | // { dg-do run { target c++11 } } |
2 | // { dg-options "-g -O0" } | |
3 | // { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } } | |
4 | ||
a5544970 | 5 | // Copyright (C) 2018-2019 Free Software Foundation, Inc. |
bab0a26d JW |
6 | // |
7 | // This file is part of the GNU ISO C++ Library. This library is free | |
8 | // software; you can redistribute it and/or modify it under the | |
9 | // terms of the GNU General Public License as published by the | |
10 | // Free Software Foundation; either version 3, or (at your option) | |
11 | // any later version. | |
12 | ||
13 | // This library is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | ||
18 | // You should have received a copy of the GNU General Public License along | |
19 | // with this library; see the file COPYING3. If not see | |
20 | // <http://www.gnu.org/licenses/>. | |
21 | ||
22 | #include <iostream> | |
23 | #include <list> | |
24 | #include <memory> | |
25 | #include <set> | |
26 | #include <string> | |
27 | #include <vector> | |
28 | ||
29 | template<class T> | |
30 | void | |
31 | placeholder(const T *s) | |
32 | { | |
33 | std::cout << (void *) s; | |
34 | } | |
35 | ||
36 | int | |
37 | main() | |
38 | { | |
39 | using namespace std; | |
40 | unique_ptr<vector<unique_ptr<vector<int>*>>> p1; | |
41 | unique_ptr<vector<unique_ptr<set<int>*>>[]> p2; | |
42 | unique_ptr<set<unique_ptr<vector<int>*>>[10]> p3; | |
43 | unique_ptr<vector<unique_ptr<list<std::string>[]>>[99]> p4; | |
44 | // { dg-final { whatis-test p1 "std::unique_ptr<std::vector<std::unique_ptr<std::vector<int>*>>>" } } | |
45 | // { dg-final { whatis-test p2 "std::unique_ptr<std::vector<std::unique_ptr<std::set<int>*>>\[\]>" } } | |
46 | // { dg-final { whatis-test p3 "std::unique_ptr<std::set<std::unique_ptr<std::vector<int>*>>\[10\]>" } } | |
47 | // { dg-final { whatis-test p4 "std::unique_ptr<std::vector<std::unique_ptr<std::list<std::string>\[\]>>\[99\]>" } } | |
48 | ||
49 | placeholder(&p1); // Mark SPOT | |
50 | placeholder(&p2); | |
51 | placeholder(&p3); | |
52 | placeholder(&p4); | |
53 | ||
54 | std::cout << "\n"; | |
55 | return 0; | |
56 | } | |
57 | ||
58 | // { dg-final { gdb-test SPOT } } |