]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Also check conflicting internal-linkage entities
authorNathaniel Shead <nathanieloshead@gmail.com>
Fri, 26 Sep 2025 12:03:24 +0000 (22:03 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sun, 5 Oct 2025 10:37:32 +0000 (21:37 +1100)
commit000cde096d2f60b968890f3075e839bf19c7f4a2
treefebb1b8ba6a87aaec9bcb4078165877eb0c6e304
parent6fdee070ff386bb5c284234afa3dfda9ba3d22db
c++/modules: Also check conflicting internal-linkage entities

While investigating another issue I noticed that the condition in
check_module_override seems incorrect: the wording in [basic.link] p11
has no exceptions for internal-linkage entities.

gcc/cp/ChangeLog:

* name-lookup.cc (check_module_override): Remove check for
TREE_PUBLIC when checking mergeable entities.

gcc/testsuite/ChangeLog:

* g++.dg/modules/namespace-1_c.C: Adjust to expect errors.
* g++.dg/modules/namespace-2_b.C: Likewise.
* g++.dg/modules/namespace-3_a.C: Removed.
* g++.dg/modules/namespace-3_b.C: Removed.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/modules/namespace-1_c.C
gcc/testsuite/g++.dg/modules/namespace-2_b.C
gcc/testsuite/g++.dg/modules/namespace-3_a.C [deleted file]
gcc/testsuite/g++.dg/modules/namespace-3_b.C [deleted file]