]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: import confict with builtin
authorJason Merrill <jason@redhat.com>
Sun, 2 Nov 2025 06:44:10 +0000 (09:44 +0300)
committerJason Merrill <jason@redhat.com>
Mon, 3 Nov 2025 18:32:26 +0000 (21:32 +0300)
commit3ce87345084f963ff7ff08abbad8ca0574547ba3
tree7c64809f2051ecada49e7c24f84d256c4afee6f2
parent5926cc99ae18eb9cc5d0081c4b0e90f87c7d31e6
c++/modules: import confict with builtin

27_io/headers/iostream/synopsis.cc was failing with modules because pushdecl
called update_binding for a redeclared import while passing the built-in
clog as "old".  This could also be fixed by discarding the builtin in
e.g. import_module_binding, but this seems straightforward.

gcc/cp/ChangeLog:

* name-lookup.cc (pushdecl): Discard built-in sooner.

gcc/testsuite/ChangeLog:

* g++.dg/modules/builtin-9_a.C: New test.
* g++.dg/modules/builtin-9_b.C: New test.
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/modules/builtin-9_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/builtin-9_b.C [new file with mode: 0644]