diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-08-22 15:15:01 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-08-23 11:51:43 +1000 |
commit | 5b85364a6dd0bbfd3e26d3346b075a0819be7cd4 (patch) | |
tree | 8d51326839c2f9091db6202ac3239b8908f4a249 /libjava/classpath/javax/sound/sampled | |
parent | 64d9e5ab61e55c63e7ebaf9754af0564ea09a76b (diff) | |
download | gcc-5b85364a6dd0bbfd3e26d3346b075a0819be7cd4.zip gcc-5b85364a6dd0bbfd3e26d3346b075a0819be7cd4.tar.gz gcc-5b85364a6dd0bbfd3e26d3346b075a0819be7cd4.tar.bz2 |
c++/modules: Provide definitions of synthesized methods outside their defining module [PR120499]
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.
PR c++/120499
gcc/cp/ChangeLog:
* method.cc (synthesize_method): Set the instantiating module.
gcc/testsuite/ChangeLog:
* g++.dg/modules/imp-member-4_a.C: New test.
* g++.dg/modules/imp-member-4_b.C: New test.
* g++.dg/modules/imp-member-4_c.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Diffstat (limited to 'libjava/classpath/javax/sound/sampled')
0 files changed, 0 insertions, 0 deletions