]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Fix missed unwrapping of STAT_HACK in ADL [PR121893]
authorNathaniel Shead <nathanieloshead@gmail.com>
Fri, 12 Sep 2025 12:50:39 +0000 (22:50 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Fri, 12 Sep 2025 12:50:39 +0000 (22:50 +1000)
commit85409b9d6a29392d33f3fbac40c641eeda22062a
tree6bee9d9878b7776c86b0bbdeb8e8009ac759cde6
parentb9fde0219f35cd5244f647c20c7b31b0395dbc5a
c++/modules: Fix missed unwrapping of STAT_HACK in ADL [PR121893]

My r16-3559-gc2e567a6edb563 reworked ADL for modules, including a change
to allow seeing module-linkage declarations if they only exist on the
instantiation path.  This caused a crash however as I neglected to
unwrap the stat hack wrapper when we were happy to see all declarations,
allowing search_adl to add non-functions to the overload set.

PR c++/121893

gcc/cp/ChangeLog:

* name-lookup.cc (name_lookup::adl_namespace_fns): Unwrap the
STAT_HACK also when on_inst_path.

gcc/testsuite/ChangeLog:

* g++.dg/modules/adl-10_a.C: New test.
* g++.dg/modules/adl-10_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/modules/adl-10_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/adl-10_b.C [new file with mode: 0644]