[Bug c++/124200] [modules][reflection] members_of does not see members of namespaces provided via modules
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Mar 12 23:39:18 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124200
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathaniel Shead <nshead@gcc.gnu.org>:
https://gcc.gnu.org/g:82656ffb6f1ed459604d296ca767d8c1f8a743a1
commit r16-8067-g82656ffb6f1ed459604d296ca767d8c1f8a743a1
Author: Nathaniel Shead <nathanieloshead@gmail.com>
Date: Mon Feb 23 02:20:38 2026 +1100
c++/reflection: Support members_of and imported namespace-scope names
[PR124200]
namespace_members_of needs to iterate over all VECTOR_BINDINGs
for the given namespace, and handle deduplication.
PR c++/124200
gcc/cp/ChangeLog:
* name-lookup.h (walk_namespace_bindings): Declare.
* name-lookup.cc (walk_namespace_bindings): New function.
* reflect.cc (namespace_members_of): Use it.
gcc/testsuite/ChangeLog:
* g++.dg/modules/reflect-2_a.H: New test.
* g++.dg/modules/reflect-2_b.C: New test.
* g++.dg/modules/reflect-2_c.C: New test.
* g++.dg/modules/reflect-3_a.H: New test.
* g++.dg/modules/reflect-3_b.C: New test.
* g++.dg/modules/reflect-3_c.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Co-authored-by: Thomas Berger <loki+gcc@loki.codes>
Reviewed-by: Jason Merrill <jason@redhat.com>
Reviewed-by: Marek Polacek <polacek@redhat.com>
More information about the Gcc-bugs
mailing list