diff options
author | Patrick Palka <ppalka@redhat.com> | 2021-05-03 13:35:26 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2021-05-03 13:35:26 -0400 |
commit | eef4fa6968ae0682679c27dae06409db3d113d5d (patch) | |
tree | 68238e6b43a1003fd2966826295cf68185047fb4 /gcc/expr.c | |
parent | 34b51ea7184ebc651b39037dfea14f08722314b1 (diff) | |
download | gcc-eef4fa6968ae0682679c27dae06409db3d113d5d.zip gcc-eef4fa6968ae0682679c27dae06409db3d113d5d.tar.gz gcc-eef4fa6968ae0682679c27dae06409db3d113d5d.tar.bz2 |
c++: mark_used and ADL with template-id [PR100344]
My r11-295 patch for PR68942 didn't consider that the callee of an
ADL-eligible function call can be a TEMPLATE_ID_EXPR, and we don't want
to disable mark_used when substituting into the template arguments of
this TEMPLATE_ID_EXPR because the arguments are clearly used regardless
of the outcome of ADL. In the first testcase below, this oversight
causes us to trip over the assert in build_call_a for the call to
find_index<int> because the function no longer had its TREE_USED bit set
from mark_used.
So this patch restricts the original fix to disable mark_used only when
the callee is a FUNCTION_DECL, which seems to be the only case that
matters for PR68942. For instance, in the second testcase below we
already don't mark_used the deleted function specialization even before
r11-295.
gcc/cp/ChangeLog:
PR c++/68942
PR c++/100344
* pt.c (tsubst_copy_and_build) <case CALL_EXPR>: Set tf_conv
only when the callee is a FUNCTION_DECL.
gcc/testsuite/ChangeLog:
PR c++/68942
PR c++/100344
* g++.dg/template/call8.C: New test.
* g++.dg/template/koenig12a.C: New test.
Diffstat (limited to 'gcc/expr.c')
0 files changed, 0 insertions, 0 deletions