https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125334
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Jason Merrill <[email protected]>: https://gcc.gnu.org/g:6a6715ac786d4728416750e2bd62450321299c1b commit r16-9174-g6a6715ac786d4728416750e2bd62450321299c1b Author: Jason Merrill <[email protected]> Date: Thu Jun 25 12:16:37 2026 -0400 c++/modules: dependent ADL laziness [PR125334] I was digging into modules for another bug and remembered an earlier thought that a possible further improvement for this PR would be to just mark the ADL functions as reachable, not actual dependencies of the current entity. This turns out to be as simple as removing the call to add_dependency; the test still passes, but now the ADL functions are loaded lazily because they have their own dependency groups instead of being tightly coupled to the call site. This provides a speed-up of about 24% on the performance test in this PR with my debugging build of trunk. PR c++/125334 gcc/cp/ChangeLog: * module.cc (depset::hash::find_dependencies): Don't add_dependency dependent ADL functions. gcc/testsuite/ChangeLog: * g++.dg/modules/adl-12_b.C: Check for lazy loading. (cherry picked from commit bb26018080699913959526c89ce2e618c97768ec)
