On Fri, Jul 24, 2026 at 03:15:25PM -0400, Jason Merrill wrote:
> Ah, good point. It might make sense to do all the lookups in a first pass
> and change the indices to the FIELD_DECLs (and remove the assert/update the
> comment that we don't do this)?
I can try. That would just save the lookup during recursion, but not e.g. the
discovery of which base class (if any) it belongs to, that will need to be
done again and again during recursion.
> > Supporting the former as an extension with pedwarns is possible, but it
> > isn't about changing one error_at to pedwarn IMHO.
> > In the patch currently, the parser.cc change arranges for the
> > error_at (loc, "either all initializer clauses should be designated "
> > "or none of them should be");
> > error not to be emitted for C++29 unless it is the [0] = designator case,
> > and emit the other error
> > error_at (loc, "designated initializer clause should not "
> > "be followed by non-designated");
> > for C++29 if it is non-designated after designated (and nothing for
> > designated after non-designated).
> > What should we do for C++20 to C++26? Just emit the
> > error_at (loc, "either all initializer clauses should be designated "
> > "or none of them should be");
> > error in the non-designated after designated and emit the same thing
> > as pedwarn for designated after non-designated? I'm afraid anything else
> > would just confuse users.
>
> That's what I was thinking, yes.
Ok.
Jakub