summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc
blob: fde652e163511542d2230e16905294a1cfce811c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// { dg-do run { target c++11 } }
// { dg-options "-g -O0" }
// { dg-skip-if "" { *-*-* } { "-D_GLIBCXX_PROFILE" } }

// Copyright (C) 2018-2019 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.

#include <iostream>
#include <list>
#include <memory>
#include <set>
#include <string>
#include <vector>

template<class T>
void
placeholder(const T *s)
{
  std::cout << (void *) s;
}

int
main()
{
  using namespace std;
  unique_ptr<vector<unique_ptr<vector<int>*>>> p1;
  unique_ptr<vector<unique_ptr<set<int>*>>[]> p2;
  unique_ptr<set<unique_ptr<vector<int>*>>[10]> p3;
  unique_ptr<vector<unique_ptr<list<std::string>[]>>[99]> p4;
  // { dg-final { whatis-test p1 "std::unique_ptr<std::vector<std::unique_ptr<std::vector<int>*>>>" } }
  // { dg-final { whatis-test p2 "std::unique_ptr<std::vector<std::unique_ptr<std::set<int>*>>\[\]>" } }
  // { dg-final { whatis-test p3 "std::unique_ptr<std::set<std::unique_ptr<std::vector<int>*>>\[10\]>" } }
  // { dg-final { whatis-test p4 "std::unique_ptr<std::vector<std::unique_ptr<std::list<std::string>\[\]>>\[99\]>" } }

  placeholder(&p1);		// Mark SPOT
  placeholder(&p2);
  placeholder(&p3);
  placeholder(&p4);

  std::cout << "\n";
  return 0;
}

// { dg-final { gdb-test SPOT } }