On Mon, 29 Oct 2018, Jason Merrill wrote:

> On Mon, Oct 29, 2018 at 7:07 AM Alexander Monakov <amona...@ispras.ru> wrote:
> > On Thu, 25 Oct 2018, Jason Merrill wrote:
> > > > >
> > > > > Maybe we should remove that in favor of fold_for_warn in
> > > > > check_function_arguments.
> >
> > David, I think your patch also fixes PR 86567.
> >
> > David, Jason, could you comment on doing something similar (using 
> > fold_for_warn
> > instead of maybe_constant_value) to solve other issues where generation of 
> > new
> > tree uids under maybe_constant_value called in warning context changes code
> > generation, in particular PR 86586?
> 
> I don't see how it would help; this change does the same folding, just
> a bit later.

If David's patch causes GCC to perform that folding only after main compilation
flow has already instantiated templates, that should help: folding for warning
wouldn't try to instantiate anything not already instantiated, and thus wouldn't
cause allocation of new uids, I think?

(I did check that it helps on the std::vector testcase given in the PR)

I see that my question about fold_for_warn doesn't make sense though.

Thanks.
Alexander

Reply via email to