https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108559
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #2) > This might be related to C++ core issue cwg2403: https://wg21.link/cwg2403 Indeed. We don't expect the copy to be elided because of that issue, but we are eliding it anyway. So this is a bug caught by the added checking.