diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-04-29 13:43:00 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-04-29 13:43:00 -0400 |
commit | efeca0ac4155b76ce713155f190422aac20537c5 (patch) | |
tree | cba3a1e0e0c0c78bc56e8513585ae4419c3404e4 /libcpp/expr.c | |
parent | f24702258fc78ac37b3e8154d76239cccd30c422 (diff) | |
download | gcc-efeca0ac4155b76ce713155f190422aac20537c5.zip gcc-efeca0ac4155b76ce713155f190422aac20537c5.tar.gz gcc-efeca0ac4155b76ce713155f190422aac20537c5.tar.bz2 |
c++: Overeager use of deleted function before ADL [PR68942]
Here, at template definition time, ordinary name lookup for 'foo(t)'
finds only the deleted function, and so we form a CALL_EXPR thereof.
Later at instantiation time, when initially substituting into this
CALL_EXPR with T=N::A, we end up calling mark_used on this deleted
function (since it's the only function in the overload set), triggering
a bogus "use of deleted function error", before we get to augment the
overload set via ADL.
This patch fixes this issue by using the tf_conv flag to disable
mark_used during the initial substitution into the callee of a
CALL_EXPR when KOENIG_P, since at this point we're still figuring out
which functions are candidates.
gcc/cp/ChangeLog:
PR c++/68942
* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: When KOENIG_P,
set tf_conv during the initial substitution into the function.
gcc/testsuite/ChangeLog:
PR c++/68942
* g++.dg/template/koenig12.C: New test.
Diffstat (limited to 'libcpp/expr.c')
0 files changed, 0 insertions, 0 deletions