https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110102

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> We shouldn't be doing this transformation here, because A is a
> program-defined type and we don't know its properties.

True, though I wouldn't expect that to matter; for any sensible program I'd
expect it to be a good thing that we only construct the element directly,
rather than construct a temporary A and then copy it into the element. This
seems in the spirit of [class.copy.elision], though I agree that this situation
is not actually covered by that clause.  Perhaps it should be.

Reply via email to