summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/19_diagnostics/stacktrace/synopsis.cc
blob: 72582fa53c6a96ae6d67bb27481674db37a36c35 (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
// { dg-options "-std=gnu++23" }
// { dg-do compile { target c++23 } }
// { dg-require-effective-target stacktrace }

#include <stacktrace>

#ifndef __cpp_lib_stacktrace
# error "Feature-test macro for stacktrace missing in <stacktrace>"
#elif __cpp_lib_stacktrace < 202011L
# error "Feature-test macro for stacktrace has wrong value in <stacktrace>"
#endif

namespace std
{
  class stacktrace_entry;

  template<class Allocator>
    class basic_stacktrace;

  using stacktrace = basic_stacktrace<allocator<stacktrace_entry>>;

  template<class Allocator>
    void swap(basic_stacktrace<Allocator>& a, basic_stacktrace<Allocator>& b)
    noexcept(noexcept(a.swap(b)));

  string to_string(const stacktrace_entry& f);

  template<class Allocator>
    string to_string(const basic_stacktrace<Allocator>& st);

  template<class charT, class traits>
    basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>& os, const stacktrace_entry& f);

  template<class charT, class traits, class Allocator>
    basic_ostream<charT, traits>&
    operator<<(basic_ostream<charT, traits>& os, const basic_stacktrace<Allocator>& st);

  namespace pmr {
    using stacktrace = basic_stacktrace<polymorphic_allocator<stacktrace_entry>>;
  }

  template<class T> struct hash;
  template<> struct hash<stacktrace_entry>;
  template<class Allocator> struct hash<basic_stacktrace<Allocator>>;
}