PR libstdc++/80276 fix template argument handling in type printers
[official-gcc.git] / libstdc++-v3 / testsuite / libstdc++-prettyprinters / 80276.cc
blob343b344c32e116ed9a5c7b1b5cd7ecd3c2a4d99f
1 // { dg-do run { target c++11 } }
2 // { dg-options "-g -O0" }
3 // { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }
5 // Copyright (C) 2018 Free Software Foundation, Inc.
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.
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.
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/>.
22 #include <iostream>
23 #include <list>
24 #include <memory>
25 #include <set>
26 #include <string>
27 #include <vector>
29 template<class T>
30 void
31 placeholder(const T *s)
33 std::cout << (void *) s;
36 int
37 main()
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\]>" } }
49 placeholder(&p1); // Mark SPOT
50 placeholder(&p2);
51 placeholder(&p3);
52 placeholder(&p4);
54 std::cout << "\n";
55 return 0;
58 // { dg-final { gdb-test SPOT } }