https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122421
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathaniel Shead <[email protected]>: https://gcc.gnu.org/g:fd5c057c2d01346d69119f88ca94debf27842e4e commit r16-4930-gfd5c057c2d01346d69119f88ca94debf27842e4e 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]>
