| 1 |
// { dg-do compile { target c++23 } } |
| 2 |
// { dg-require-cpp-feature-test __cpp_lib_stacktrace } |
| 3 |
// { dg-require-normal-namespace "" } |
| 4 |
// { dg-add-options no_pch } |
| 5 |
|
| 6 |
#include <stacktrace> |
| 7 |
|
| 8 |
#ifndef __cpp_lib_stacktrace |
| 9 |
# error "Feature-test macro for stacktrace missing in <stacktrace>" |
| 10 |
#elif __cpp_lib_stacktrace < 202011L |
| 11 |
# error "Feature-test macro for stacktrace has wrong value in <stacktrace>" |
| 12 |
#endif |
| 13 |
|
| 14 |
namespace std |
| 15 |
{ |
| 16 |
class stacktrace_entry; |
| 17 |
|
| 18 |
template<class Allocator> |
| 19 |
class basic_stacktrace; |
| 20 |
|
| 21 |
using stacktrace = basic_stacktrace<allocator<stacktrace_entry>>; |
| 22 |
|
| 23 |
template<class Allocator> |
| 24 |
void swap(basic_stacktrace<Allocator>& a, basic_stacktrace<Allocator>& b) |
| 25 |
noexcept(noexcept(a.swap(b))); |
| 26 |
|
| 27 |
string to_string(const stacktrace_entry& f); |
| 28 |
|
| 29 |
template<class Allocator> |
| 30 |
string to_string(const basic_stacktrace<Allocator>& st); |
| 31 |
|
| 32 |
ostream& |
| 33 |
operator<<(ostream& os, const stacktrace_entry& f); |
| 34 |
|
| 35 |
template<class Allocator> |
| 36 |
ostream& |
| 37 |
operator<<(ostream& os, const basic_stacktrace<Allocator>& st); |
| 38 |
|
| 39 |
template<> struct formatter<stacktrace_entry>; |
| 40 |
template<class Allocator> struct formatter<basic_stacktrace<Allocator>>; |
| 41 |
|
| 42 |
namespace pmr { |
| 43 |
using stacktrace = basic_stacktrace<polymorphic_allocator<stacktrace_entry>>; |
| 44 |
} |
| 45 |
|
| 46 |
template<class T> struct hash; |
| 47 |
template<> struct hash<stacktrace_entry>; |
| 48 |
template<class Allocator> struct hash<basic_stacktrace<Allocator>>; |
| 49 |
} |