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

--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #11)
> Even if we don't emit a loop (which I still think is the way to go for
> larger initializers because anything else means just too large code), can't
> there for the larger initializers simply be some variable holding a counter
> how many initializers have been already initialized and a single EH region
> that will perform all the cleanups based on that counter?

We already do that for cleaning up the array itself; the problem is any
temporaries created while initializing array elements.  That's why I was
thinking about a parallel array of temporaries.  Though that would only work if
all the element initializers construct the same temporaries, which is true in
this case but not in general.

But really I think we should try to avoid constructing an array of std::string
in the first place, as in comment #12.

Reply via email to