https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100823
--- 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:87a9bfe86d8a87d09de5d60e430d14bfa6c816f0 commit r13-1771-g87a9bfe86d8a87d09de5d60e430d14bfa6c816f0 Author: Jonathan Wakely <jwak...@redhat.com> Date: Wed Jul 20 16:51:44 2022 +0100 libstdc++: Fix std::common_iterator triviality [PR100823] This fixes the remaining problem reported in the PR, that the special members should be trivial. This can be done by constraining the non-trivial versions and adding defaulted overloads that will be used when the union members are trivial. Making these members trivial alters the argument passing ABI and so isn't suitable for backporting to release branches. libstdc++-v3/ChangeLog: PR libstdc++/100823 * include/bits/stl_iterator.h (common_iterator): Define destructor, copy constructor and move constructor as trivial when the underlying types allow. * testsuite/24_iterators/common_iterator/100823.cc: Check triviality of special members.