From: Nathaniel Shead Date: Mon, 1 Dec 2025 23:24:01 +0000 (+1100) Subject: c++/modules: Remove incorrect is_import check in using-directives X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=58305f56176bb1f1f1050211e42eff0056ac1c9c;p=thirdparty%2Fgcc.git c++/modules: Remove incorrect is_import check in using-directives When I wrote this check in r16-5811 I was thinking of checking if the using-directive was imported, but this just checks if the target namespace was imported, which is not what we want. We don't build deps to see if the using-directive itself was imported, so just remove the check. I haven't been able to come up with a testcase this breaks but it still seems reasonable to adjust. gcc/cp/ChangeLog: * module.cc (module_state::write_using_directives): Correct condition. Signed-off-by: Nathaniel Shead --- diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 042b029a036..5c70e9bb469 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -17652,7 +17652,7 @@ module_state::write_using_directives (elf_out *to, depset::hash &table, have been walked earlier (PR c++/122915). But importers will be able to just refer to the decl in that module unless it was a partition anyway, so we don't have anything to do here. */ - if (!target_dep || target_dep->is_import ()) + if (!target_dep) { gcc_checking_assert (DECL_MODULE_IMPORT_P (udir)); continue;