https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122774
--- Comment #10 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:394e626ed19a73b6c30ce62c6be9148357c2a43d commit r16-9745-g394e626ed19a73b6c30ce62c6be9148357c2a43d Author: Jason Merrill <[email protected]> Date: Wed Oct 7 17:23:39 2026 -0400 c++/modules: redeclaring built-ins [PR122774] Here we merged the export from _a with the built-in declaration in _b, but the latter is still hidden in the overload set. Then when we go to push a new declaration we ignore the built-in one. But since they've already been merged, we end up with two of the same decl in the overload set. Fixed by checking DECL_IS_UNDECLARED_BUILTIN instead, as that is no longer true after merging. PR c++/122774 gcc/cp/ChangeLog: * name-lookup.cc (pushdecl): Check DECL_IS_UNDECLARED_BUILTIN rather than iter.hidden_p (). gcc/testsuite/ChangeLog: * g++.dg/modules/gmf-7_a.C: New test. * g++.dg/modules/gmf-7_b.C: New test.
