diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-07-18 09:22:49 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-07-18 09:22:49 -0400 |
commit | cde17323f950ac372691efd0a740fe0b4d7914a4 (patch) | |
tree | 4b1bc2a95b82568a1215143e5ca3e0cc72afe5a6 /libgcc | |
parent | 1e0f37df1b12cd91a6dbb523f5c722f9a961edaa (diff) | |
download | gcc-cde17323f950ac372691efd0a740fe0b4d7914a4.zip gcc-cde17323f950ac372691efd0a740fe0b4d7914a4.tar.gz gcc-cde17323f950ac372691efd0a740fe0b4d7914a4.tar.bz2 |
c++: non-standalone surrogate call template
I noticed we're accidentally prevented from considering a pointer- or
reference-to-function conversion function template if it's not the first
conversion function that's considered, which for the testcase below
results in us accepting the B call but not the A call despite the only
difference between A and B being their order of member declarations.
This patch fixes this so that the outcome of overload resolution doesn't
arbitrarily depend on declaration order here.
gcc/cp/ChangeLog:
* call.cc (add_template_conv_candidate): Don't check for
non-empty 'candidates' here.
(build_op_call): Check it here, before we've considered any
conversion functions.
gcc/testsuite/ChangeLog:
* g++.dg/overload/conv-op5.C: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions