diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-08-18 11:36:40 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-08-20 17:14:11 +1000 |
commit | 6f115a8eeea41d383dfb1bbb1af6ac9a97aee180 (patch) | |
tree | 7515e1d1a7735749ce8edc56b19125bb5e0a4f79 /gcc/fortran | |
parent | 0b7904e274fbd6a736d63c0fed28ea32f9cb5997 (diff) | |
download | gcc-6f115a8eeea41d383dfb1bbb1af6ac9a97aee180.zip gcc-6f115a8eeea41d383dfb1bbb1af6ac9a97aee180.tar.gz gcc-6f115a8eeea41d383dfb1bbb1af6ac9a97aee180.tar.bz2 |
c++/modules: Handle transitive reachability for deduction guides [PR116403]
Currently we implement [temp.deduct.guide] p1 by forcing all deduction
guides to be considered as exported. However this is not sufficient:
for transitive non-exported imports we will still hide the deduction
guide from name lookup, causing errors.
This patch instead adjusts name lookup to have a new ANY_REACHABLE flag
to allow for this case. Currently this is only used by deduction guides
but there are some other circumstances where this may be useful in the
future (e.g. finding existing temploid friends).
PR c++/116403
gcc/cp/ChangeLog:
* pt.cc (deduction_guides_for): Use ANY_REACHABLE for lookup of
deduction guides.
* module.cc (depset::hash::add_deduction_guides): Likewise.
(module_state::write_cluster): No longer override deduction
guides as exported.
* name-lookup.cc (name_lookup::search_namespace_only): Ignore
visibility when LOOK_want::ANY_REACHABLE is specified.
(check_module_override): Ignore visibility when checking for
ambiguating deduction guides.
* name-lookup.h (LOOK_want): New flag 'ANY_REACHABLE'.
gcc/testsuite/ChangeLog:
* g++.dg/modules/dguide-4_a.C: New test.
* g++.dg/modules/dguide-4_b.C: New test.
* g++.dg/modules/dguide-4_c.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions