]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Ensure deduction guides for imported types are reachable [PR120023]
authorNathaniel Shead <nathanieloshead@gmail.com>
Wed, 30 Apr 2025 13:35:51 +0000 (23:35 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Wed, 30 Apr 2025 23:51:41 +0000 (09:51 +1000)
commitfb4583566afdee50aad12e1219610813b44bdff4
tree2f940899096cfc689f9f4c6dcafac15dbc4346ef
parentd613678c94f06809656e56b37f314501b37a5ddd
c++/modules: Ensure deduction guides for imported types are reachable [PR120023]

In the linked PR, because the deduction guides depend on an imported
type, we never walk the type and so never call add_deduction_guides.
This patch ensures that we make bindings for deduction guides if we saw
any deduction guide at all.

PR c++/120023

gcc/cp/ChangeLog:

* module.cc (depset::hash::find_dependencies): Also call
add_deduction_guides when walking one.

gcc/testsuite/ChangeLog:

* g++.dg/modules/dguide-7_a.C: New test.
* g++.dg/modules/dguide-7_b.C: New test.
* g++.dg/modules/dguide-7_c.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/dguide-7_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/dguide-7_b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/dguide-7_c.C [new file with mode: 0644]