https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112307
--- Comment #10 from Raffael Casagrande <raffael at casagrande dot ch> --- (In reply to Jonathan Wakely from comment #9) Thanks very much! I missed the part with the trivial copy constructor and learned again an important lesson. That explains why it works when I defined the copy constructors manually.