diff options
author | Patrick Palka <ppalka@redhat.com> | 2025-05-01 10:58:50 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2025-05-01 10:58:50 -0400 |
commit | 1fb5abc3919f376f3dedccad636eba4a4ad7e4a7 (patch) | |
tree | 664200f6850de41ca571aa63ea893cc5deeeda25 /gcc/rust/backend/rust-compile-struct-field-expr.cc | |
parent | 0abc77da9d704bba55a376bb5c162a54826ab94a (diff) | |
download | gcc-1fb5abc3919f376f3dedccad636eba4a4ad7e4a7.zip gcc-1fb5abc3919f376f3dedccad636eba4a4ad7e4a7.tar.gz gcc-1fb5abc3919f376f3dedccad636eba4a4ad7e4a7.tar.bz2 |
c++: more overeager use of deleted function before ADL [PR119034]
The PR68942 fix used the tf_conv flag to disable mark_used when
substituting a FUNCTION_DECL callee of an ADL-enabled call. In this
slightly more elaborate testcase, we end up prematurely calling
mark_used anyway on the FUNCTION_DECL directly from the CALL_EXPR case
of tsubst_expr during partial instantiation, leading to a bogus "use of
deleted function" error.
This patch fixes the general problem in a more robust way by ensuring
the callee of an ADL-enabled call is wrapped in an OVERLOAD, so that
tsubst_expr leaves it alone.
PR c++/119034
PR c++/68942
gcc/cp/ChangeLog:
* pt.cc (tsubst_expr) <case CALL_EXPR>: Revert PR68942 fix.
* semantics.cc (finish_call_expr): Ensure the callee of an
ADL-enabled call is wrapped in an OVERLOAD.
gcc/testsuite/ChangeLog:
* g++.dg/template/koenig13.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/rust/backend/rust-compile-struct-field-expr.cc')
0 files changed, 0 insertions, 0 deletions