https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105031
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jonathan Wakely <r...@gcc.gnu.org>: https://gcc.gnu.org/g:73da9ec55609efa532b9ac85ac2dbe121c134e18 commit r12-8089-g73da9ec55609efa532b9ac85ac2dbe121c134e18 Author: Jonathan Wakely <jwak...@redhat.com> Date: Mon Apr 11 17:44:14 2022 +0100 libstdc++: Fix std::basic_stacktrace special members [PR105031] The PR points out that there is a non-constant condition used for an if-constexpr statement, but there are several other problems with the copy, move and swap members of std::basic_stacktrace. libstdc++-v3/ChangeLog: PR libstdc++/105031 * include/std/stacktrace (basic_stacktrace::basic_stacktrace): Fix allocator usage in constructors. (basic_stacktrace::operator=(const basic_stacktrace&)): Do not try to reallocate using const allocator. (basic_stacktrace::operator=(basic_stacktrace&&)): Fix if-constexpr with non-constant condition. Do not allocate new storage if allocator propagates. Do not set _M_size if allocation fails. (basic_stacktrace::swap(basic_stacktrace&)): Fix typo. Add assertion that non-propagating allocators are equal. * testsuite/19_diagnostics/stacktrace/stacktrace.cc: New test.