#include <iostream> #include <stacktrace> int main() { std::stacktrace trace{}; std::cout << trace.max_size() << std::endl; } outputs: In file included from <source>:2: /opt/compiler-explorer/gcc-14.1.0/include/c++/14.1.0/stacktrace: In instantiation of 'std::basic_stacktrace<_Allocator>::size_type std::basic_stacktrace<_Allocator>::max_size() const [with _Allocator = std::allocator<std::stacktrace_entry>; size_type = short unsigned int]': <source>:6:30: required from here 6 | std::cout << trace.max_size() << std::endl; | ~~~~~~~~~~~~~~^~ /opt/compiler-explorer/gcc-14.1.0/include/c++/14.1.0/stacktrace:433:43: error: 'const struct std::basic_stacktrace<std::allocator<std::stacktrace_entry> >::_Impl' has no member named '_M_alloc'; did you mean '_M_allocate'? 433 | { return _Impl::_S_max_size(_M_impl._M_alloc); } | ~~~~~~~~^~~~~~~~ | _M_allocate Compiler returned: 1
The releases/gcc-14 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:c60205cd4aeea586b7b1fe06baa9861b6d279648 commit r14-10207-gc60205cd4aeea586b7b1fe06baa9861b6d279648 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon May 13 16:25:13 2024 +0100 libstdc++: Fix typo in std::stacktrace::max_size [PR115063] libstdc++-v3/ChangeLog: PR libstdc++/115063 * include/std/stacktrace (basic_stacktrace::max_size): Fix typo in reference to _M_alloc member. * testsuite/19_diagnostics/stacktrace/stacktrace.cc: Check max_size() compiles. (cherry picked from commit dd9677f3343ca2a4b4aab9428b8129774accac29)
The releases/gcc-13 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:7dca716decf5a07f903610fda9457ff0422d2758 commit r13-8772-g7dca716decf5a07f903610fda9457ff0422d2758 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon May 13 16:25:13 2024 +0100 libstdc++: Fix typo in std::stacktrace::max_size [PR115063] libstdc++-v3/ChangeLog: PR libstdc++/115063 * include/std/stacktrace (basic_stacktrace::max_size): Fix typo in reference to _M_alloc member. * testsuite/19_diagnostics/stacktrace/stacktrace.cc: Check max_size() compiles. (cherry picked from commit dd9677f3343ca2a4b4aab9428b8129774accac29)
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:ccc26a1af07b34ce2e7d3b2497f27992d1b1bbc2 commit r15-481-gccc26a1af07b34ce2e7d3b2497f27992d1b1bbc2 Author: Jonathan Wakely <jwakely@redhat.com> Date: Mon May 13 16:25:13 2024 +0100 libstdc++: Fix typo in std::stacktrace::max_size [PR115063] libstdc++-v3/ChangeLog: PR libstdc++/115063 * include/std/stacktrace (basic_stacktrace::max_size): Fix typo in reference to _M_alloc member. * testsuite/19_diagnostics/stacktrace/stacktrace.cc: Check max_size() compiles.
Fixed for 13.3 and 14.2, thanks for the report.