On Sat, Aug 23, 2025 at 01:18:19PM -0400, Patrick Palka wrote:
> On Fri, 22 Aug 2025, Nathaniel Shead wrote:
> 
> > Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk?
> > 
> > -- >8 --
> > 
> > In the PR, we're getting a linker error from _Vector_impl's destructor
> > never getting emitted.  This is because of a combination of factors:
> > 
> > 1. in imp-member-4_a, the destructor is not used and so there is no
> >    definition generated.
> > 
> > 2. in imp-member-4_b, the destructor gets synthesized (as part of the
> >    synthesis for Coll's destructor) but is not ODR-used and so does not
> >    get emitted.  Despite there being a definition provided in this TU,
> >    the destructor is still considered imported and so isn't streamed
> >    into the module body.
> > 
> > 3. in imp-member-4_c, we need to ODR-use the destructor but we only got
> >    a forward declaration from imp-member-4_b, so we cannot emit a body.
> > 
> > The point of failure here is step 2; this function has effectively been
> > declared in the imp-member-4_b module, and so we shouldn't treat it as
> > imported.  This way we'll properly stream the body so that importers can
> > emit it.
> 
> Nice analysis and fix!  What do you think about backporting this to 15?

Seems reasonable to me; it's not a regression but feels very safe and
fixes an otherwise quite confusing error.  I'm happy to do that, OK if
regtest passes?

Reply via email to