https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120349

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>:

https://gcc.gnu.org/g:870e66a3fcbde185c086f10e63ac1c9fe946e233

commit r16-754-g870e66a3fcbde185c086f10e63ac1c9fe946e233
Author: Nathaniel Shead <nathanielosh...@gmail.com>
Date:   Mon May 19 22:11:13 2025 +1000

    c++/modules: Ensure vtables are emitted when needed [PR120349]

    I missed a testcase in r16-688-gc875748cdc468e for whether a GM vtable
    should be emitted in an importer when it has no non-inline key function.
    Before that patch the code worked because always we marked all vtables
    as DECL_EXTERNAL, which then meant that reading the definition marked
    them as DECL_NOT_REALLY_EXTERN.

    This patch restores the old behaviour so that vtables are marked
    DECL_EXTERNAL (and hence DECL_NOT_REALLY_EXTERN).

            PR c++/120349

    gcc/cp/ChangeLog:

            * module.cc (trees_out::core_bools): Always mark vtables as
            DECL_EXTERNAL.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/vtt-3_a.C: New test.
            * g++.dg/modules/vtt-3_b.C: New test.

    Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>
    Reviewed-by: Jason Merrill <ja...@redhat.com>

Reply via email to