https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103549
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-12-04 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- I think this is intentional, or at least not a bug. The match_results type can't be used for much until it's "ready" and the member will be set then. But it looks like this would read the indeterminate value: cmatch m1, m2; m1.swap(m2); So we should initialize it as you suggest.