Re: [PATCH] c++: fix array initialization wrong code [PR126335]

Marek Polacek <[email protected]>
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
On Fri, Jul 31, 2026 at 01:58:15PM -0400, Jason Merrill wrote:
> On 7/31/26 1:49 PM, Patrick Palka wrote:
> > On Fri, 24 Jul 2026, Marek Polacek wrote:
> > 
> > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?
> > > 
> > > -- >8 --
> > > This is a wrong-code problem starting with the recent check_initializer
> > > simplification (r17-1661).  I thought the fix would be to bring some of
> > > those dropped conditions back, but now I think the change just uncovered
> > > a latent bug.
> > 
> > FWIW it seems the aforementioned latent bug causes PR126472 and your
> > patch fixes it on trunk!  I wonder if backporting this patch to the 16
> > branch would make sense without r17-1661?

Nice.
 
> I think so, but let's wait a bit to see if the assert breaks anything.

Sounds good, I'll wait 1-2 weeks.  For trunk, I think we might want to
add the https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126472#c2 test.

Marek
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.