diff options
author | Jason Merrill <jason@redhat.com> | 2021-02-18 21:27:37 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-02-18 23:01:03 -0500 |
commit | d909ead68214042e9876a8df136d0835273d4b86 (patch) | |
tree | 0608841f5780518ad27c2301f2f9374fb9b11760 /gcc/fortran/simplify.c | |
parent | b258e263e0d74ca1f76aeaac5f4d1abef6b13707 (diff) | |
download | gcc-d909ead68214042e9876a8df136d0835273d4b86.zip gcc-d909ead68214042e9876a8df136d0835273d4b86.tar.gz gcc-d909ead68214042e9876a8df136d0835273d4b86.tar.bz2 |
c++: Tweak PR969626 patch
It occurred to me that other types of conversions use rvaluedness_matches_p,
but those uses don't affect overload resolution, so we shouldn't look at the
flag for them. Fixing that made decltype64.C compile successfully, because
the non-template candidate was a perfect match, so we now wouldn't consider
the broken template. Changing the argument to const& makes it no longer a
perfect match (because of the added const), so we again get the infinite
recursion.
This illustrates the limited nature of this optimization/recursion break; it
works for most copy/move constructors because the constructor we're looking
for is almost always a perfect match. If it happens to help improve compile
time for other calls, that's just a bonus.
gcc/cp/ChangeLog:
PR c++/96926
* call.c (perfect_conversion_p): Limit rvalueness
test to reference bindings.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/decltype64.C: Change argument to const&.
Diffstat (limited to 'gcc/fortran/simplify.c')
0 files changed, 0 insertions, 0 deletions