summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/19_diagnostics/stacktrace/synopsis.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/19_diagnostics/stacktrace/synopsis.cc')
-rw-r--r--libstdc++-v3/testsuite/19_diagnostics/stacktrace/synopsis.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/19_diagnostics/stacktrace/synopsis.cc b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/synopsis.cc
new file mode 100644
index 00000000000..72582fa53c6
--- /dev/null
+++ b/libstdc++-v3/testsuite/19_diagnostics/stacktrace/synopsis.cc
@@ -0,0 +1,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>>;
+}