On Tue, 5 May 2026, Jakub Jelinek wrote:

> On Tue, May 05, 2026 at 05:48:15PM -0400, Patrick Palka wrote:
> > +struct consteval_only_p_walker
> > +{
> > +  /* The stack of class types we're recursively inside.  */
> > +  auto_vec<tree> class_stack;
> 
> Why is this auto_vec<tree> rather than just int?
> I mean, it is used as:
> 
> > +      class_stack.safe_push (t);
> 
> and 
> 
> > +          && (class_stack.length () == 1 || !optimistic_p))
> 
> and
> 
> > +      class_stack.pop ();
> 
> and nowhere else.  So, if it is int and the first one does
>   ++class_stack_cnt;
> the second
>   && (class_stack_cnt == 1 || !optimistic_p)
> and the last one
>   --class_stack_cnt;
> I think it should behave identically except for (tiny bit)
> smaller compile time memory + compile time due to no need to allocate/free
> it.

It's a vestige of one of the earlier overly clever versions and indeed
not really necessary.  Will replace with an int before pushing.

Reply via email to