]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Mark implicit using-directive for imported unnamed namespace as imported...
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 8 Jan 2026 09:38:43 +0000 (20:38 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Fri, 9 Jan 2026 10:37:56 +0000 (21:37 +1100)
commit9813e49e95bc4bc2f0e030a7fdd0e7ef63c056fc
tree9947fb25faf1d49eb485b6ae2f88c9b609a32e53
parentd5835ae7bfe80af4a9912bedcdd484303e986f4f
c++/modules: Mark implicit using-directive for imported unnamed namespace as imported [PR123393]

The assertion failure in the PR is due to the implicit using-directive
for the anonymous namespace not being considered imported, because
make_namespace_finish calls add_using_namespace without propagating
'from_import'.

PR c++/123393

gcc/cp/ChangeLog:

* name-lookup.cc (make_namespace_finish): Pass from_import to
add_using_namespace.

gcc/testsuite/ChangeLog:

* g++.dg/modules/namespace-18_a.C: New test.
* g++.dg/modules/namespace-18_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/modules/namespace-18_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/namespace-18_b.C [new file with mode: 0644]