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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Nathaniel Shead
<[email protected]>:

https://gcc.gnu.org/g:59213fd40fe5f272f603f5b8303d2c371f05c7a5

commit r15-10474-g59213fd40fe5f272f603f5b8303d2c371f05c7a5
Author: Nathaniel Shead <[email protected]>
Date:   Sun Oct 26 22:27:33 2025 +1100

    c++/modules: Track all static class variables [PR122421]

    The linker error in the PR is caused because when a static is defined
    out of the class body, it doesn't yet have a definition and so
    read_var_def (which would otherwise have noted it) never gets called.

    This instead moves the responsibility for noting class-scope variables
    to read_class_def.

            PR c++/122421

    gcc/cp/ChangeLog:

            * module.cc (trees_in::read_var_def): Don't handle class-scope
            variables anymore.
            (trees_in::read_class_def): Handle them here instead.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/inst-6_a.C: New test.
            * g++.dg/modules/inst-6_b.C: New test.

    Signed-off-by: Nathaniel Shead <[email protected]>
    Reviewed-by: Jason Merrill <[email protected]>
    (cherry picked from commit fd5c057c2d01346d69119f88ca94debf27842e4e)

Reply via email to